Class ValueConstraint
- java.lang.Object
-
- com.sun.appserv.web.cache.mapping.ValueConstraint
-
public class ValueConstraint extends Object
ValueConstraint class represents a field's value constraint; supports common matching expressions.
-
-
Constructor Summary
Constructors Constructor Description ValueConstraint(String value, String expr)
create constraint: field value matches with the given string expression
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
matches(Object value)
match with the givenObject
value.void
setCacheOnMatch(boolean cacheOnMatch)
set whether to cache if there was a matchvoid
setCacheOnMatchFailure(boolean cacheOnMatchFailure)
set whether to cache if there was a failure to matchvoid
setMatchExpr(int expr)
set field matching expressionvoid
setMaxValue(float value)
set the maximum valuevoid
setMinValue(float value)
set minimum valuevoid
setValue(String value)
set value for this constraintString
toString()
-
-
-
Constructor Detail
-
ValueConstraint
public ValueConstraint(String value, String expr) throws IllegalArgumentException
create constraint: field value matches with the given string expression- Parameters:
value
- specific value to matchexpr
- match expression- Throws:
IllegalArgumentException
-
-
Method Detail
-
setValue
public void setValue(String value)
set value for this constraint- Parameters:
value
- specific value to match
-
setMinValue
public void setMinValue(float value)
set minimum value- Parameters:
value
- minimum value
-
setMaxValue
public void setMaxValue(float value)
set the maximum value- Parameters:
value
- maximum value
-
setMatchExpr
public void setMatchExpr(int expr)
set field matching expression- Parameters:
expr
- match expression
-
setCacheOnMatch
public void setCacheOnMatch(boolean cacheOnMatch)
set whether to cache if there was a match- Parameters:
cacheOnMatch
- should the field value match, enable cache?
-
setCacheOnMatchFailure
public void setCacheOnMatchFailure(boolean cacheOnMatchFailure)
set whether to cache if there was a failure to match- Parameters:
cacheOnMatchFailure
- should the field value doesn't match, enable cache?
-
matches
public boolean matches(Object value)
match with the givenObject
value.- Returns:
true
if the value passes the constraint,false
otherwise.
-
-