Package edu.vt.middleware.ldap.bean
Class AbstractLdapAttribute<T extends java.util.Set<java.lang.Object>>
- java.lang.Object
-
- edu.vt.middleware.ldap.bean.AbstractLdapBean
-
- edu.vt.middleware.ldap.bean.AbstractLdapAttribute<T>
-
- Type Parameters:
T- type of backing set
- All Implemented Interfaces:
LdapAttribute
- Direct Known Subclasses:
OrderedLdapBeanFactory.OrderedLdapAttribute,SortedLdapBeanFactory.SortedLdapAttribute,UnorderedLdapBeanFactory.UnorderedLdapAttribute
public abstract class AbstractLdapAttribute<T extends java.util.Set<java.lang.Object>> extends AbstractLdapBean implements LdapAttribute
AbstractLdapAttributeprovides a base implementation ofLdapAttributewhere the underlying values are backed by aSet.- Version:
- $Revision: 1330 $ $Date: 2010-05-24 00:10:53 +0200 (Mon, 24 May 2010) $
- Author:
- Middleware Services
-
-
Field Summary
Fields Modifier and Type Field Description protected static intHASH_CODE_SEEDhash code seed.protected java.lang.StringnameName for this attribute.protected java.util.Set<java.lang.Object>valuesValues for this attribute.-
Fields inherited from class edu.vt.middleware.ldap.bean.AbstractLdapBean
beanFactory, logger
-
-
Constructor Summary
Constructors Constructor Description AbstractLdapAttribute(LdapBeanFactory lbf)Creates a newAbstractLdapAttributewith the supplied ldap bean factory.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidconvertValuesToString(java.util.Set<java.lang.String> stringValues)Converts the underlying set of objects to a set of strings.java.lang.StringgetName()This returns the name of thisLdapAttribute.abstract java.util.Set<java.lang.String>getStringValues()This returns the value(s) of thisLdapAttributeValues 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 thisLdapAttribute.inthashCode()This returns the hash code for this object.voidsetAttribute(javax.naming.directory.Attribute attribute)This sets thisLdapAttributeusing the supplied attribute.voidsetName(java.lang.String name)This sets the name of thisLdapAttribute.javax.naming.directory.AttributetoAttribute()This returns anAttributethat represents the values in thisLdapAttribute.java.lang.StringtoString()This returns a string representation of this object.-
Methods inherited from class edu.vt.middleware.ldap.bean.AbstractLdapBean
equals
-
-
-
-
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 newAbstractLdapAttributewith the supplied ldap bean factory.- Parameters:
lbf-LdapBeanFactory
-
-
Method Detail
-
getName
public java.lang.String getName()
This returns the name of thisLdapAttribute.- Specified by:
getNamein interfaceLdapAttribute- Returns:
String
-
getValues
public java.util.Set<java.lang.Object> getValues()
This returns the value(s) of thisLdapAttribute.- Specified by:
getValuesin interfaceLdapAttribute- Returns:
Set
-
getStringValues
public abstract java.util.Set<java.lang.String> getStringValues()
This returns the value(s) of thisLdapAttributeValues are encoded in base64 format if the underlying value is of type byte[]. The returned set is unmodifiable.- Specified by:
getStringValuesin interfaceLdapAttribute- Returns:
- unmodifiable
Set
-
setAttribute
public void setAttribute(javax.naming.directory.Attribute attribute) throws javax.naming.NamingExceptionThis sets thisLdapAttributeusing the supplied attribute.- Specified by:
setAttributein interfaceLdapAttribute- 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 thisLdapAttribute.- Specified by:
setNamein interfaceLdapAttribute- Parameters:
name-String
-
hashCode
public int hashCode()
This returns the hash code for this object.- Specified by:
hashCodein classAbstractLdapBean- Returns:
int
-
toString
public java.lang.String toString()
This returns a string representation of this object.- Overrides:
toStringin classjava.lang.Object- Returns:
String
-
toAttribute
public javax.naming.directory.Attribute toAttribute()
This returns anAttributethat represents the values in thisLdapAttribute.- Specified by:
toAttributein interfaceLdapAttribute- 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-Setto populate with strings
-
-