com.amazon.carbonado.constraint
Annotation Type FloatConstraint


@Documented
@Retention(value=RUNTIME)
@Target(value=METHOD)
@ConstraintDefinition
public @interface FloatConstraint

Limits the value of a property to be a member of a specific set. The property value may be a boxed or unboxed float, double, String, CharSequence, char, Character, or character array. If the property value is outside the set, an IllegalArgumentException is thrown.

Example:

 public interface PolarCoordinate extends Storable {
     double getTheta();
     @FloatConstraint(min=0, max=Math.PI * 2, disallowed=Double.NaN)
     void setTheta(double radians);

     ...
 }
 

Author:
Brian S O'Neill
See Also:
IntegerConstraint, TextConstraint

Optional Element Summary
 double[] allowed
          Specific allowed values for property.
 double[] disallowed
          Specific disallowed values for property.
 double max
          Specify maximum allowed value for float/double property.
 double min
          Specify minimum allowed value for float/double property.
 

allowed

public abstract double[] allowed
Specific allowed values for property. Default is unlimited.

Default:
{}

disallowed

public abstract double[] disallowed
Specific disallowed values for property. Default is none.

Default:
{}

min

public abstract double min
Specify minimum allowed value for float/double property. Default is unlimited.

Default:
-1d/0d

max

public abstract double max
Specify maximum allowed value for float/double property. Default is unlimited.

Default:
1d/0d


Copyright © 2006-2009 Amazon Technologies, Inc.. All Rights Reserved.