Class DisplayString<V extends org.snmp4j.smi.OctetString>

Type Parameters:
V - the OctetString subclass that defines the base Variable class of this display string.
All Implemented Interfaces:
Comparable<MOColumn<V>>

public class DisplayString<V extends org.snmp4j.smi.OctetString> extends MOMutableColumn<V>
The DisplayString class implements the DisplayString textual convention as defined by the SNMPv2-TC MIB specification for columnar objects.
Version:
3.4.1
Author:
Frank Fock
  • Field Details

  • Constructor Details

    • DisplayString

      public DisplayString(int columnID, MOAccess access, V defaultValue, boolean mutableInService)
    • DisplayString

      public DisplayString(int columnID, MOAccess access, V defaultValue)
    • DisplayString

      public DisplayString(int columnID, MOAccess access, V defaultValue, boolean mutableInService, int minSize, int maxSize)
  • Method Details

    • validate

      public int validate(V newValue, V oldValue, org.snmp4j.smi.OID instanceOID)
      Description copied from class: MOMutableColumn
      Validate the new value for a mutable column based on old value and (new in v3.7.0) the instance OID.
      Overrides:
      validate in class MOMutableColumn<V extends org.snmp4j.smi.OctetString>
      Parameters:
      newValue - the new value to be set.
      oldValue - the existing value.
      instanceOID - the instance OID of the table cell to be modified.
      Returns:
      SnmpConstants.SNMP_ERROR_SUCCESS if the change is OK, otherwise a SNMP error status.
    • validateDisplayString

      public static <V extends org.snmp4j.smi.Variable> int validateDisplayString(V displayString, ValueConstraint sizeConstraints)
      Validates a variable as a DisplayString OCTET STRING. If the variable is not an OctetString instance, wrongType is returned as error status. Otherwise wrongValue is returned if the string contains non-printable characters other than 'return' and 'new-line'.
      Type Parameters:
      V - the OctetString subclass that defines the base Variable class of this display string. If V is not an OctetString, SnmpConstants.SNMP_ERROR_WRONG_TYPE will be returned always.
      Parameters:
      displayString - a variable to validate.
      sizeConstraints - a constraint for the size (length) of the string.
      Returns:
      a SNMP error status if the variable is not a valid DisplayString or zero if it is.