Class AuthenticationState
- java.lang.Object
-
- org.forgerock.caf.authentication.api.AuthenticationState
-
-
Constructor Summary
Constructors Constructor Description AuthenticationState()
Creates a newAuthenticationState
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthenticationState
add(String key, Object object)
Adds the specified value.Boolean
asBoolean()
Returns theAuthenticationState
as aBoolean
object.Integer
asInteger()
Returns theAuthenticationState
as anInteger
object.AuthenticationState
get(String key)
Returns the specified item value.boolean
isDefined(String key)
Returnstrue
if thisAuthenticationState
contains the specified item.
-
-
-
Method Detail
-
add
public AuthenticationState add(String key, Object object)
Adds the specified value.
If adding to a list value, the specified key must be parseable as an unsigned base-10 integer and be less than or equal to the list size. Adding a value to a list shifts any existing elements at or above the specified index to the right by one.
- Parameters:
key
- TheMap
key orList
index to add.object
- The Java object to add.- Returns:
- This
AuthenticationState
. - Throws:
AuthenticationStateException
- If not aMap
or theMap
key already exists.
-
isDefined
public boolean isDefined(String key)
Returnstrue
if thisAuthenticationState
contains the specified item.- Parameters:
key
- TheMap
key orList
index of the item to seek.- Returns:
true
if thisAuthenticationState
contains the specified member.- Throws:
NullPointerException
- Ifkey
isnull
.
-
get
public AuthenticationState get(String key)
Returns the specified item value. If no such member value exists, then aAuthenticationState
containingnull
is returned.- Parameters:
key
- TheMap
key orList
index identifying the item to return.- Returns:
- a
AuthenticationState
containing the value ornull
.
-
asBoolean
public Boolean asBoolean()
Returns theAuthenticationState
as aBoolean
object. If the value isnull
, this method returnsnull
.- Returns:
- The boolean value.
- Throws:
AuthenticationStateException
- If the value is not a boolean type.
-
asInteger
public Integer asInteger()
Returns theAuthenticationState
as anInteger
object. This may involve rounding or truncation. If the value isnull
, this method returnsnull
.- Returns:
- The integer value.
- Throws:
AuthenticationStateException
- If the value is not a number.
-
-