Package org.forgerock.am.cts.api.query
Interface PartialToken
-
public interface PartialTokenRepresents a partial CTSToken. Used to represent the result of a query where only selective attributes of the Token have been requested. Importantly, this is not a full Token and cannot be used as such. The main use case of this PartialToken is an optimisation when requesting data from the CTS and not all fields are required.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanConvertToToken()Check if thisPartialTokencan be converted into aToken.Collection<CoreTokenField>getFields()The fields that were included in this query.<T> TgetValue(CoreTokenField field)TokentoToken()Converts thisPartialTokeninto aTokencontaining all of the populated fields.
-
-
-
Method Detail
-
getFields
Collection<CoreTokenField> getFields()
The fields that were included in this query.- Returns:
- A unmodifiable collection of fields.
-
getValue
<T> T getValue(CoreTokenField field)
- Type Parameters:
T- The return type, simplifies- Parameters:
field- The field to return.- Returns:
- The value that was stored or null if this PartialToken does not contain the requested field.
-
canConvertToToken
boolean canConvertToToken()
Check if thisPartialTokencan be converted into aToken.- Returns:
- true if this
PartialTokencontainsCoreTokenField.TOKEN_IDandCoreTokenField.TOKEN_TYPE. - Since:
- 14.0.0
- See Also:
toToken()
-
toToken
Token toToken()
Converts thisPartialTokeninto aTokencontaining all of the populated fields.Callers should ensure that this
PartialTokencan be converted by callingcanConvertToToken()before calling this method.- Returns:
- A
Token. - Throws:
IllegalStateException- if thisPartialTokendoes not containCoreTokenField.TOKEN_IDandCoreTokenField.TOKEN_TYPE.- Since:
- 14.0.0
- See Also:
canConvertToToken()
-
-