public class AttributesAccessor extends Object
AttributeUtil.find(String, Set)
method, since that method must
re-create the map each time.Constructor and Description |
---|
AttributesAccessor(Set<Attribute> attrs) |
Modifier and Type | Method and Description |
---|---|
Attribute |
find(String name)
Find the named attribute
|
BigDecimal |
findBigDecimal(String name)
Get the big decimal value from the specified (single-valued) attribute.
|
Boolean |
findBoolean(String name)
Get the boolean value from the specified (single-valued) attribute.
|
Date |
findDate(String name)
Get the date value from the specified (single-valued) attribute that
contains a long.
|
Double |
findDouble(String name)
Get the integer value from the specified (single-valued) attribute.
|
Integer |
findInteger(String name)
Get the integer value from the specified (single-valued) attribute.
|
List<Object> |
findList(String name)
Return a list of attributes
|
Long |
findLong(String name)
Get the long value from the specified (single-valued) attribute.
|
String |
findString(String name)
Get the string value from the specified (single-valued) attribute.
|
List<String> |
findStringList(String name)
Return the multivalued attribute as a list of strings.
|
boolean |
getEnabled(boolean dflt)
Return the enabled status of the account.
|
Name |
getName()
Get the
Name attribute from the set of attributes. |
GuardedString |
getPassword()
Get the password as a GuardeString
|
Uid |
getUid()
Get the
Uid attribute from the set of attributes. |
boolean |
hasAttribute(String name)
Determines if the set as the attribute specified.
|
public Attribute find(String name)
name
- -
the attribute name to search forpublic Name getName()
Name
attribute from the set of attributes.Name
attribute in the set.public Uid getUid()
Uid
attribute from the set of attributes.Uid
attribute in the set.public boolean getEnabled(boolean dflt)
dflt
- the default state if enable is not found.public GuardedString getPassword()
public List<Object> findList(String name)
name
- -
name of attribute to search for.public List<String> findStringList(String name)
name
- the name of the attribute to search forpublic boolean hasAttribute(String name)
name
- attribute namepublic String findString(String name)
name
- Attribute from which to retrieve the long value.ClassCastException
- iff the object in the attribute is not an long.IllegalArgumentException
- iff the attribute is a multi-valued (rather than
single-valued).public Integer findInteger(String name)
name
- Attribute from which to retrieve the long value.ClassCastException
- iff the object in the attribute is not an long.IllegalArgumentException
- iff the attribute is a multi-valued (rather than
single-valued).public Long findLong(String name)
name
- Attribute from which to retrieve the long value.ClassCastException
- iff the object in the attribute is not an long.IllegalArgumentException
- iff the attribute is a multi-valued (rather than
single-valued).public Date findDate(String name)
name
- Attribute from which to retrieve the date value.ClassCastException
- iff the object in the attribute is not an long.IllegalArgumentException
- iff the attribute is a multi-valued (rather than
single-valued).public Double findDouble(String name)
name
- Attribute from which to retrieve the integer value.ClassCastException
- iff the object in the attribute is not an integer.IllegalArgumentException
- iff the attribute is a multi-valued (rather than
single-valued)..public BigDecimal findBigDecimal(String name)
name
- Attribute from which to retrieve the big decimal value.ClassCastException
- iff the object in the attribute is not an big decimal.IllegalArgumentException
- iff the attribute is a multi-valued (rather than
single-valued).public Boolean findBoolean(String name)
name
- Attribute from which to retrieve the boolean value.ClassCastException
- iff the object in the attribute is not an Boolean
.IllegalArgumentException
- iff the attribute is a multi-valued (rather than
single-valued).Copyright © 2013. All Rights Reserved.