com.atlassian.crowd.integration.directory
Class AttributeValuesHolder

java.lang.Object
  extended by com.atlassian.crowd.integration.directory.AttributeValuesHolder
All Implemented Interfaces:
AttributeAware

public class AttributeValuesHolder
extends java.lang.Object
implements AttributeAware

Concrete implementation of AttributeAware interface. This is useful for places where we want 'composition' instead of 'inheritence'.


Constructor Summary
AttributeValuesHolder(java.util.Map<java.lang.String,java.lang.String> attributes)
           
 
Method Summary
 java.lang.String getAttribute(java.lang.String name)
           
 boolean getAttributeAsBoolean(java.lang.String name, boolean defaultValue)
           
 long getAttributeAsLong(java.lang.String name, long defaultValue)
           
 java.util.Set<java.lang.String> getAttributeNames()
           
 java.util.Map<java.lang.String,java.lang.String> getAttributes()
           
 java.util.List<java.lang.String> getAttributes(java.lang.String name)
           
 boolean hasAttribute(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeValuesHolder

public AttributeValuesHolder(java.util.Map<java.lang.String,java.lang.String> attributes)
Method Detail

getAttributes

public java.util.List<java.lang.String> getAttributes(java.lang.String name)
Specified by:
getAttributes in interface AttributeAware
Parameters:
name - attribute name.
Returns:
collection of attribute values or an empty list if the attribute with the given name does not exist.

getAttribute

public java.lang.String getAttribute(java.lang.String name)
Specified by:
getAttribute in interface AttributeAware
Parameters:
name - attribute name.
Returns:
single attribute value or null if the attribute with the given name does not exist. If multiple attribute values exist, any one could be returned.

getAttributeAsLong

public long getAttributeAsLong(java.lang.String name,
                               long defaultValue)

getAttributeAsBoolean

public boolean getAttributeAsBoolean(java.lang.String name,
                                     boolean defaultValue)

getAttributeNames

public java.util.Set<java.lang.String> getAttributeNames()
Specified by:
getAttributeNames in interface AttributeAware
Returns:
set of attribute names.

hasAttribute

public boolean hasAttribute(java.lang.String name)
Specified by:
hasAttribute in interface AttributeAware
Parameters:
name - attribute name.
Returns:
true if an only if the user has an attribute with the supplied name and has one or more values.

getAttributes

public java.util.Map<java.lang.String,java.lang.String> getAttributes()


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.