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 booleanmatches(Object value)match with the givenObjectvalue.voidsetCacheOnMatch(boolean cacheOnMatch)set whether to cache if there was a matchvoidsetCacheOnMatchFailure(boolean cacheOnMatchFailure)set whether to cache if there was a failure to matchvoidsetMatchExpr(int expr)set field matching expressionvoidsetMaxValue(float value)set the maximum valuevoidsetMinValue(float value)set minimum valuevoidsetValue(String value)set value for this constraintStringtoString()
-
-
-
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 givenObjectvalue.- Returns:
trueif the value passes the constraint,falseotherwise.
-
-