- java.lang.Object
-
- org.snmp4j.agent.mo.snmp.smi.EnumerationConstraint
-
- All Implemented Interfaces:
ValueConstraint
public class EnumerationConstraint extends Object implements ValueConstraint
TheEnumerationConstraintclass checks anInteger32value to match a set of (enumerated) values or aOctetStringvalue to match a set of bit values for the BITS SMI type.- Version:
- 1.2
- Author:
- Frank Fock
-
-
Constructor Summary
Constructors Constructor Description EnumerationConstraint(int[] allowedValues)Creates anEnumerationConstraintbased on the specified array of integer values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intvalidate(org.snmp4j.smi.Variable variable)Indicates whether a SNMP value matches this value constraint.
-
-
-
Method Detail
-
validate
public int validate(org.snmp4j.smi.Variable variable)
Description copied from interface:ValueConstraintIndicates whether a SNMP value matches this value constraint.- Specified by:
validatein interfaceValueConstraint- Parameters:
variable- a SNMP value that has to match the type of SNMP value thisValueConstraintsupports. Otherwise a wrongType error should be returned instead of throwing aClassCastException.- Returns:
- a SNMP error status (e.g. wrongValue) if the value does not match the constraint, or zero if it matches.
-
-