org.javalid.annotations.validation
Annotation Type MinValue


@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
@Documented
public @interface MinValue

Checks if annotated method returns a value with given minimum value. Can be annotated on methods returning:

The equivalent primitives of given list are valid too. Use value() to set.

Also supports:

However you must use the bigValue() property in that case.

Since:
1.0
Version:
1.0
Author:
M.Reuvers

Optional Element Summary
 java.lang.String[] applyToGroups
          Specify for which groups this annotation must be applied.
 java.lang.String bigValue
          Set the minimum value for BigInteger / BigDecimal.
 java.lang.String customCodeMinValue
          Optional custom code (property from a properties file) if the minvalue is violated.
 java.lang.String customCodeNotNumeric
          Optional custom code (property from a properties file) if the not numeric is violated.
 boolean globalMessage
          If this annotation's message must be added as global message instead of real validation path.
 double value
          The minimum value the method annotated should return.
 

value

public abstract double value
The minimum value the method annotated should return. This property must be used for all primitive types.

Defaults to nothing (0.0 by java specs).

Default:
0.0

bigValue

public abstract java.lang.String bigValue
Set the minimum value for BigInteger / BigDecimal. Defaults to an empty String.

Default:
""

applyToGroups

public abstract java.lang.String[] applyToGroups
Specify for which groups this annotation must be applied. By default if you annotate without this variable, the annotation is applied for any group on that method (which is what you usually want). However by specifying the exact groups you can turn on/off a validation on a method depending on the group you validate. Defaults to JvGroup.GROUP_APPLY_ALL

Default:
"_all_"

customCodeMinValue

public abstract java.lang.String customCodeMinValue
Optional custom code (property from a properties file) if the minvalue is violated. If set, this one is used instead of the default one specified in MessageCodes for annotated method.

This way you can override the default message if needed.

Default:
""

customCodeNotNumeric

public abstract java.lang.String customCodeNotNumeric
Optional custom code (property from a properties file) if the not numeric is violated. If set, this one is used instead of the default one specified in MessageCodes for annotated method.

This way you can override the default message if needed.

Default:
""

globalMessage

public abstract boolean globalMessage
If this annotation's message must be added as global message instead of real validation path. Defaults to false (thus will be added with validation path if invalid).

Default:
false