Class AuthenticationState
- java.lang.Object
-
- org.forgerock.caf.authentication.api.AuthenticationState
-
-
Constructor Summary
Constructors Constructor Description AuthenticationState()Creates a newAuthenticationStateinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthenticationStateadd(String key, Object object)Adds the specified value.BooleanasBoolean()Returns theAuthenticationStateas aBooleanobject.IntegerasInteger()Returns theAuthenticationStateas anIntegerobject.AuthenticationStateget(String key)Returns the specified item value.booleanisDefined(String key)Returnstrueif thisAuthenticationStatecontains 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- TheMapkey orListindex to add.object- The Java object to add.- Returns:
- This
AuthenticationState. - Throws:
AuthenticationStateException- If not aMapor theMapkey already exists.
-
isDefined
public boolean isDefined(String key)
Returnstrueif thisAuthenticationStatecontains the specified item.- Parameters:
key- TheMapkey orListindex of the item to seek.- Returns:
trueif thisAuthenticationStatecontains the specified member.- Throws:
NullPointerException- Ifkeyisnull.
-
get
public AuthenticationState get(String key)
Returns the specified item value. If no such member value exists, then aAuthenticationStatecontainingnullis returned.- Parameters:
key- TheMapkey orListindex identifying the item to return.- Returns:
- a
AuthenticationStatecontaining the value ornull.
-
asBoolean
public Boolean asBoolean()
Returns theAuthenticationStateas aBooleanobject. 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 theAuthenticationStateas anIntegerobject. 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.
-
-