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.
|
BigInteger |
findBigInteger(String name)
Get the big integer value from the specified (single-valued) attribute.
|
Boolean |
findBoolean(String name)
Get the boolean value from the specified (single-valued) attribute.
|
Byte |
findByte(String name)
Get the byte value from the specified (single-valued) attribute.
|
Byte[] |
findByteArray(String name)
Get the byte array value from the specified (single-valued) attribute.
|
Character |
findCharacter(String name)
Get the character 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 double value from the specified (single-valued) attribute.
|
Float |
findFloat(String name)
Get the float value from the specified (single-valued) attribute.
|
GuardedByteArray |
findGuardedByteArray(String name)
Get the guarded byte array value from the specified (single-valued)
attribute.
|
GuardedString |
findGuardedString(String name)
Get the guarded string 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.
|
Map<String,Object> |
findMap(String name)
Get the map 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 defaultTo)
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.
|
Set<String> |
listAttributeNames()
Get the name of attributes this Accessor was created with.
|
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 defaultTo)
defaultTo
- 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 Set<String> listAttributeNames()
public boolean hasAttribute(String name)
name
- attribute namepublic String findString(String name)
name
- Attribute from which to retrieve the long value.ClassCastException
- if the object in the attribute is not an long.IllegalArgumentException
- if the attribute is a multi-valued (rather than
single-valued).public Character findCharacter(String name)
name
- Attribute from which to retrieve the character value.ClassCastException
- if the object in the attribute is not a character.IllegalArgumentException
- if 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
- if the object in the attribute is not an long.IllegalArgumentException
- if 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
- if the object in the attribute is not an long.IllegalArgumentException
- if 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
- if the object in the attribute is not an long.IllegalArgumentException
- if the attribute is a multi-valued (rather than
single-valued).public Double findDouble(String name)
name
- Attribute from which to retrieve the double value.ClassCastException
- if the object in the attribute is not a double.IllegalArgumentException
- if the attribute is a multi-valued (rather than
single-valued)..public Float findFloat(String name)
name
- Attribute from which to retrieve the float value.ClassCastException
- if the object in the attribute is not a float.IllegalArgumentException
- if 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
- if the object in the attribute is not an big decimal.IllegalArgumentException
- if 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
- if the object in the attribute is not an Boolean
.IllegalArgumentException
- if the attribute is a multi-valued (rather than
single-valued).public Byte findByte(String name)
name
- Attribute from which to retrieve the byte value.ClassCastException
- if the object in the attribute is not a byte.IllegalArgumentException
- if the attribute is a multi-valued (rather than
single-valued).public Byte[] findByteArray(String name)
name
- Attribute from which to retrieve the byte array value.ClassCastException
- if the object in the attribute is not a byte.IllegalArgumentException
- if the attribute is a multi-valued (rather than
single-valued).public BigInteger findBigInteger(String name)
name
- Attribute from which to retrieve the big integer value.ClassCastException
- if the object in the attribute is not a big integer.IllegalArgumentException
- if the attribute is a multi-valued (rather than
single-valued).public GuardedByteArray findGuardedByteArray(String name)
name
- Attribute from which to retrieve the guarded byte array value.ClassCastException
- if the object in the attribute is not a guarded byte array.IllegalArgumentException
- if the attribute is a multi-valued (rather than
single-valued).public GuardedString findGuardedString(String name)
name
- Attribute from which to retrieve the guarded string value.ClassCastException
- if the object in the attribute is not a guarded string.IllegalArgumentException
- if the attribute is a multi-valued (rather than
single-valued).public Map<String,Object> findMap(String name)
name
- Attribute from which to retrieve the map value.ClassCastException
- if the object in the attribute is not a map.IllegalArgumentException
- if the attribute is a multi-valued (rather than
single-valued).Copyright © 2022. All rights reserved.