Annotation Type SingletonCollection


  • @Retention(RUNTIME)
    @Target(FIELD)
    public @interface SingletonCollection
    This rule enables you to restrict a collection property to contain only zero or one elements. Type = exclusive-property Attributes: message: override the default error message
    • Field Summary

      Fields 
      Modifier and Type Fields Description
      static java.lang.String DEFAULT_MESSAGE  
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String message  
    • Field Detail

      • DEFAULT_MESSAGE

        static final java.lang.String DEFAULT_MESSAGE
    • Element Detail

      • message

        java.lang.String message
        Default:
        "The collection property can not contain more than 1 item, found: %s"