public class ValueRangeConstraint extends java.lang.Object implements Constraint
Constructor and Description |
---|
ValueRangeConstraint(MibFileRef fileRef,
MibValue lower,
boolean strictLower,
MibValue upper,
boolean strictUpper)
Creates a new value range constraint.
|
Modifier and Type | Method and Description |
---|---|
MibValue |
getLowerBound()
Returns the lower bound value.
|
MibValue |
getUpperBound()
Returns the upper bound value.
|
void |
initialize(MibType type,
MibLoaderLog log)
Initializes the constraint.
|
boolean |
isCompatible(MibType type)
Checks if the specified type is compatible with this
constraint.
|
boolean |
isCompatible(MibValue value)
Checks if the specified value is compatible with this
constraint.
|
boolean |
isCompatible(java.lang.Number value)
Checks if the specified value is compatible with this
constraint.
|
java.lang.String |
toString()
Returns a string representation of this object.
|
public ValueRangeConstraint(MibFileRef fileRef, MibValue lower, boolean strictLower, MibValue upper, boolean strictUpper)
fileRef
- the constraint MIB file locationlower
- the lower bound, or null for minimumstrictLower
- the strict lower bound (less than) flagupper
- the upper bound, or null for maximumstrictUpper
- the strict upper bound (greater than) flagpublic void initialize(MibType type, MibLoaderLog log) throws MibException
initialize
in interface Constraint
type
- the type to constrainlog
- the MIB loader logMibException
- if an error was encountered during the
initializationpublic boolean isCompatible(MibType type)
isCompatible
in interface Constraint
type
- the type to checkpublic boolean isCompatible(MibValue value)
isCompatible
in interface Constraint
value
- the value to checkpublic boolean isCompatible(java.lang.Number value)
value
- the (integer) value to checkpublic MibValue getLowerBound()
public MibValue getUpperBound()
public java.lang.String toString()
toString
in class java.lang.Object