ValueConstraint
public class EnumerationConstraint extends java.lang.Object implements ValueConstraint
EnumerationConstraint
class checks an Integer32
value to match a set of (enumerated) values or a OctetString
value to match a set of bit values for the BITS SMI type.Constructor | Description |
---|---|
EnumerationConstraint(int[] allowedValues) |
Creates an
EnumerationConstraint based on the specified array
of integer values. |
Modifier and Type | Method | Description |
---|---|---|
int |
validate(org.snmp4j.smi.Variable variable) |
Indicates whether a SNMP value matches this value constraint.
|
public EnumerationConstraint(int[] allowedValues)
EnumerationConstraint
based on the specified array
of integer values.allowedValues
- an array of allowed values.public int validate(org.snmp4j.smi.Variable variable)
ValueConstraint
validate
in interface ValueConstraint
variable
- a SNMP value that has to match the type of SNMP value this
ValueConstraint
supports. Otherwise a wrongType error
should be returned instead of throwing a
ClassCastException
.Copyright © 2018 SNMP4J.org. All rights reserved.