Class NameValue


  • public final class NameValue
    extends Object
    Container for a RDN name value pair.
    • Field Detail

      • HASH_CODE_SEED

        private static final int HASH_CODE_SEED
        hash code seed.
        See Also:
        Constant Field Values
      • attributeName

        private final String attributeName
        Attribute name.
      • attributeValue

        private final byte[] attributeValue
        Attribute value.
    • Constructor Detail

      • NameValue

        public NameValue​(String name,
                         String value)
        Creates a new name value.
        Parameters:
        name - of the attribute
        value - of the attribute
      • NameValue

        public NameValue​(String name,
                         byte[] value)
        Creates a new name value.
        Parameters:
        name - of the attribute
        value - of the attribute
    • Method Detail

      • getName

        public String getName()
        Returns the attribute name.
        Returns:
        attribute name
      • getBinaryValue

        public byte[] getBinaryValue()
      • getStringValue

        public String getStringValue()
      • getValue

        public <T> T getValue​(Function<byte[],​T> func)
      • hasName

        public boolean hasName​(String name)
        Returns whether the attribute name matches the supplied name.
        Parameters:
        name - to match
        Returns:
        whether name matches the attribute name
      • format

        public String format()
        Returns a string representation of this name value, of the form 'name=value'.
        Returns:
        string form of the name value pair
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object