Class AbstractLdapAttribute<T extends java.util.Set<java.lang.Object>>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static int HASH_CODE_SEED
      hash code seed.
      protected java.lang.String name
      Name for this attribute.
      protected java.util.Set<java.lang.Object> values
      Values for this attribute.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void convertValuesToString​(java.util.Set<java.lang.String> stringValues)
      Converts the underlying set of objects to a set of strings.
      java.lang.String getName()
      This returns the name of this LdapAttribute.
      abstract java.util.Set<java.lang.String> getStringValues()
      This returns the value(s) of this LdapAttribute Values are encoded in base64 format if the underlying value is of type byte[].
      java.util.Set<java.lang.Object> getValues()
      This returns the value(s) of this LdapAttribute.
      int hashCode()
      This returns the hash code for this object.
      void setAttribute​(javax.naming.directory.Attribute attribute)
      This sets this LdapAttribute using the supplied attribute.
      void setName​(java.lang.String name)
      This sets the name of this LdapAttribute.
      javax.naming.directory.Attribute toAttribute()
      This returns an Attribute that represents the values in this LdapAttribute.
      java.lang.String toString()
      This returns a string representation of this object.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • HASH_CODE_SEED

        protected static final int HASH_CODE_SEED
        hash code seed.
        See Also:
        Constant Field Values
      • name

        protected java.lang.String name
        Name for this attribute.
      • values

        protected java.util.Set<java.lang.Object> values
        Values for this attribute.
    • Constructor Detail

      • AbstractLdapAttribute

        public AbstractLdapAttribute​(LdapBeanFactory lbf)
        Creates a new AbstractLdapAttribute with the supplied ldap bean factory.
        Parameters:
        lbf - LdapBeanFactory
    • Method Detail

      • getName

        public java.lang.String getName()
        This returns the name of this LdapAttribute.
        Specified by:
        getName in interface LdapAttribute
        Returns:
        String
      • getValues

        public java.util.Set<java.lang.Object> getValues()
        This returns the value(s) of this LdapAttribute.
        Specified by:
        getValues in interface LdapAttribute
        Returns:
        Set
      • getStringValues

        public abstract java.util.Set<java.lang.String> getStringValues()
        This returns the value(s) of this LdapAttribute Values are encoded in base64 format if the underlying value is of type byte[]. The returned set is unmodifiable.
        Specified by:
        getStringValues in interface LdapAttribute
        Returns:
        unmodifiable Set
      • setAttribute

        public void setAttribute​(javax.naming.directory.Attribute attribute)
                          throws javax.naming.NamingException
        This sets this LdapAttribute using the supplied attribute.
        Specified by:
        setAttribute in interface LdapAttribute
        Parameters:
        attribute - Attribute
        Throws:
        javax.naming.NamingException - if the attribute values cannot be read
      • setName

        public void setName​(java.lang.String name)
        This sets the name of this LdapAttribute.
        Specified by:
        setName in interface LdapAttribute
        Parameters:
        name - String
      • hashCode

        public int hashCode()
        This returns the hash code for this object.
        Specified by:
        hashCode in class AbstractLdapBean
        Returns:
        int
      • toString

        public java.lang.String toString()
        This returns a string representation of this object.
        Overrides:
        toString in class java.lang.Object
        Returns:
        String
      • toAttribute

        public javax.naming.directory.Attribute toAttribute()
        This returns an Attribute that represents the values in this LdapAttribute.
        Specified by:
        toAttribute in interface LdapAttribute
        Returns:
        Attribute
      • convertValuesToString

        protected void convertValuesToString​(java.util.Set<java.lang.String> stringValues)
        Converts the underlying set of objects to a set of strings. Objects of type byte[] are base64 encoded. Objects which are not of type String or byte[] are converted using Object.toString().
        Parameters:
        stringValues - Set to populate with strings