Uses of Interface
org.forgerock.util.Function
Package
Description
ForgeRock API Descriptor models.
Models and manages elements of the Hypertext Transfer Protocol.
Provides an API for the traversal and manipulation of JSON object model structures in Java.
Core library for JSON cryptographic operations.
Classes and interfaces for core types including connections, request
handlers, resources, and their exceptions.
Forgerock Facebook Client Implementation.
OAuth 2.0 ForgeRock Client Implementation.
OpenID Connect ForgeRock Client Implementation.
Classes and interfaces for core types including connections, entries, and
attributes.
Classes and interfaces for constructing and querying LDAP schemas.
Provides a unified API for accessing secrets of various kinds.
Contains secret credential related API objects.
Implementations of
SecretStore
for accessing keys stored in Java KeyStores, such as
PKCS#11 Hardware Security Modules (HSMs) and PKCS#12 file-based encrypted key stores.Provides common interfaces and classes.
An implementation of the
Promise
API in Java.-
Uses of Function in org.forgerock.api.models
Modifier and TypeClassDescriptionclass
Iterates over each JsonValue node in the JsonValue structure and if it's a String marked for translation, It replaces the String with a LocalizableString. -
Uses of Function in org.forgerock.http.protocol
Modifier and TypeMethodDescriptionstatic <V,
E extends Exception>
Function<NeverThrowsException,V, E> Responses.noopExceptionFunction()
Utility method returning an empty function, whose goal is to ease the transformation of aPromise
type.static <E extends Exception>
Function<E,Response, NeverThrowsException> Responses.onExceptionInternalServerError()
Utility function that returns aResponse
whose status isStatus.INTERNAL_SERVER_ERROR
and the exception attached to the response as the cause. -
Uses of Function in org.forgerock.json
Modifier and TypeClassDescriptionclass
Modifier and TypeMethodDescriptionstatic Function<JsonValue,
byte[], JsonValueException> JsonValueFunctions.base64Binary()
Returns abyte[]
by converting the JsonValue usingJsonValue.asString()
and thenBase64
-decoding the result.static Function<JsonValue,
byte[], JsonValueException> JsonValueFunctions.base64urlBinary()
Returns abyte[]
by converting the JsonValue usingJsonValue.asString()
and thenBase64url
-decoding the result.static Function<JsonValue,
Charset, JsonValueException> JsonValueFunctions.charset()
Returns the JSON string value as a character set used for byte encoding/decoding.static Function<JsonValue,
JsonValue, JsonValueException> JsonValueFunctions.deepTransformBy
(Function<JsonValue, ?, JsonValueException> function) Returns the JSON value as the result of a deep JsonValue object-traversal, applying the provided transformfunction
to each element.static Function<JsonValue,
Duration, JsonValueException> JsonValueFunctions.duration()
Returns the JSON string value as aDuration
.static <T extends Enum<T>>
Function<JsonValue,T, JsonValueException> JsonValueFunctions.enumConstant
(Class<T> type) Returns the JSON string value as an enum constant of the specified enum type.static Function<JsonValue,
Instant, JsonValueException> JsonValueFunctions.epochSecondsInstant()
Returns aInstant
by converting the JsonValue into a number and interpreting that as the number of seconds since the UTC epoch as perInstant.ofEpochSecond(long)
.static Function<JsonValue,
File, JsonValueException> JsonValueFunctions.file()
Returns the JSON string value as aFile
object.static Function<JsonValue,
JsonValue, JsonValueException> JsonValueFunctions.identity()
Deprecated.static Function<JsonValue,
Instant, JsonValueException> JsonValueFunctions.instant()
JsonValueFunctions.integer()
Returns anInteger
by converting the JsonValue usingJsonValue.asInteger()
, or by parsing the JsonValue string usingInteger.parseInt(String)
.Returns the JSON value as aList
containing objects whose type (and value) is specified by a transformation function.static Function<JsonValue,
Optional<JsonValue>, JsonValueException> JsonValueFunctions.optional()
Return anOptional
if the given JsonValue has a value, orOptional.empty()
if the JsonValue contains a null value.static <T> Function<JsonValue,
Optional<T>, JsonValueException> JsonValueFunctions.optionalOf
(Function<JsonValue, T, JsonValueException> mappingFunction) Return anOptional
of a new type if the given JsonValue has a value, orOptional.empty()
if the JsonValue contains a null value.static Function<JsonValue,
Boolean, NeverThrowsException> JsonValueFunctions.parseBoolean()
Returns aBoolean
by converting the JsonValue usingJsonValue.asLong()
, or by parsing the JsonValue string usingBoolean.parseBoolean(String)
.static Function<JsonValue,
Long, NumberFormatException> JsonValueFunctions.parseLong()
Returns aLong
by converting the JsonValue usingJsonValue.asLong()
, or by parsing the JsonValue string usingLong.parseLong(String)
.static Function<JsonValue,
Pattern, JsonValueException> JsonValueFunctions.pattern()
Returns the JSON string value as a regular expression pattern.JsonValueFunctions.pointer()
Returns the JSON string value as a JSON pointer.static <V> Function<JsonValue,
Set<V>, JsonValueException> Returns the JSON value as aSet
containing objects whose type (and value) is specified by the parametertype
.Returns the JSON value as aSet
containing objects whose type (and value) is specified by a transformation function.static Function<JsonValue,
List<String>, JsonValueException> JsonValueFunctions.stringOrListOfStrings()
Return a list of string values from the given JsonValue.static Function<JsonValue,
URI, JsonValueException> JsonValueFunctions.uri()
Returns the JSON string value as a uniform resource identifier.static Function<JsonValue,
URL, JsonValueException> JsonValueFunctions.url()
Returns the JSON string value as a uniform resource locator.static Function<JsonValue,
UUID, JsonValueException> JsonValueFunctions.uuid()
Returns the JSON string value as a universally unique identifier (UUID).Modifier and TypeMethodDescription<V,
E extends Exception>
VReturns the JSON value as an object whose type (and value) is specified by a transformation function.static Function<JsonValue,
JsonValue, JsonValueException> JsonValueFunctions.deepTransformBy
(Function<JsonValue, ?, JsonValueException> function) Returns the JSON value as the result of a deep JsonValue object-traversal, applying the provided transformfunction
to each element.Returns the JSON value as aList
containing objects whose type (and value) is specified by a transformation function.static <T> Function<JsonValue,
Optional<T>, JsonValueException> JsonValueFunctions.optionalOf
(Function<JsonValue, T, JsonValueException> mappingFunction) Return anOptional
of a new type if the given JsonValue has a value, orOptional.empty()
if the JsonValue contains a null value.Returns the JSON value as aSet
containing objects whose type (and value) is specified by a transformation function.ModifierConstructorDescriptionJsonValueTraverseFunction
(Function<JsonValue, ?, JsonValueException> transform) Construct the traversal function with a transformation function to apply to each array element nested object attribute value element, or primitive element. -
Uses of Function in org.forgerock.json.crypto
-
Uses of Function in org.forgerock.json.resource
Modifier and TypeMethodDescriptionJsonValueFunctions.queryFilter()
Parses and returns the JSON string value as aQueryFilter
.JsonValueFunctions.resourcePath()
Returns the JSON string value as aResourcePath
. -
Uses of Function in org.forgerock.oauth.clients.facebook
Modifier and TypeMethodDescriptionprotected Function<JsonValue,
JsonValue, OAuthException> FacebookClient.validateClientId
(DataStore dataStore, JsonValue storedData, String inputToken) -
Uses of Function in org.forgerock.oauth.clients.oauth2
Modifier and TypeFieldDescriptionprotected final Function<JsonValue,
JsonValue, OAuthException> OAuth2Client.addExpireTime
Adds the actual time the token expires.Modifier and TypeMethodDescriptionprotected final Function<Void,
JsonValue, OAuthException> OAuth2Client.createPostAuthResponse
(JsonValue storedData) Creates the post auth response.protected final Function<JsonValue,
UserInfo, OAuthException> OAuth2Client.mapToUserInfo()
Creates aOAuth2UserInfo
using a users raw profile.protected final Function<JsonValue,
Void, OAuthException> OAuth2Client.storeResponse
(DataStore dataStore) Stores all the information received from an authentication or authorization server.protected static <T> Function<NoSuchSecretException,
T, OAuthException> OAuth2Client.throwIfNoClientSecret()
Handles a missing client secret.protected Function<JsonValue,
JsonValue, OAuthException> OAuth2Client.validateClientId
(DataStore dataStore, JsonValue storedData, String inputToken) Compare client_id from access token associated data with configured client_id. -
Uses of Function in org.forgerock.oauth.clients.oidc
Modifier and TypeMethodDescriptionprotected final Function<JsonValue,
UserInfo, OAuthException> OpenIDConnectClient.mapToUserInfo
(JwtClaimsSet jwtClaims) Maps a retrieved raw profile from the user info endpoint to anOpenIDConnectUserInfo
object.protected final Function<JsonValue,
JsonValue, OAuthException> OpenIDConnectClient.validateSub
(DataStore dataStore) Validates the sub Claim in the UserInfo Response is an exact match to the sub Claim in the ID Token. -
Uses of Function in org.forgerock.opendj.ldap
Modifier and TypeMethodDescriptionFunctions.byteStringToBoolean()
Returns a function which parsesBoolean
values.Functions.byteStringToDn()
Returns a function which parsesDN
s using the default schema.Functions.byteStringToDn
(Schema schema) Returns a function which parsesDN
s using the provided schema.Functions.byteStringToGeneralizedTime()
Returns a function which parses generalized time strings.Functions.byteStringToInteger()
Returns a function which parsesInteger
string values.Functions.byteStringToLong()
Returns a function which parsesLong
string values.Functions.byteStringToPath()
Returns a function which parsesPath
string values.static <M,
N> Function<M, N, NeverThrowsException> Functions.constant
(N constant) Creates a function that returns constant value for any input.Modifier and TypeMethodDescription<T,
E extends Exception>
TAttributeParser.as
(Function<ByteString, ? extends T, E> f) Returns the first value decoded as aT
using the providedFunction
, ornull
if the attribute does not contain any values.<T,
E extends Exception>
TAttributeParser.as
(Function<ByteString, ? extends T, E> f, T defaultValue) Returns the first value decoded as aT
using the providedFunction
, ordefaultValue
if the attribute does not contain any values.AttributeParser.asSetOf
(Function<ByteString, ? extends T, E> f, Collection<? extends T> defaultValues) Returns the values decoded as a set ofT
s using the providedFunction
, ordefaultValues
if the attribute does not contain any values.AttributeParser.asSetOf
(Function<ByteString, ? extends T, E> f, T... defaultValues) Returns the values decoded as a set ofT
s using the providedFunction
, ordefaultValues
if the attribute does not contain any values.AttributeParser.asSetOfString
(Function<String, ? extends T, E> f, Collection<? extends T> defaultValues) Returns the values decoded as a set ofT
s from their string representations using the providedFunction
, ordefaultValues
if the attribute does not contain any values.AttributeParser.asSetOfString
(Function<String, ? extends T, E> f, T... defaultValues) Returns the values decoded as a set ofT
s from their string representations using the providedFunction
, ordefaultValues
if the attribute does not contain any values.<T,
E extends Exception>
TReturns the first value decoded as aT
from its string representation using the providedFunction
, ornull
if the attribute does not contain any values.<T,
E extends Exception>
TReturns the first value decoded as aT
from its string representation using the providedFunction
, or thedefaultValue
if the attribute does not contain any values.<VOUT> LdapPromise<VOUT>
LdapPromise.then
(Function<? super S, VOUT, LdapException> onResult) ModifierConstructorDescriptionConsistentHashMap
(Function<Object, Integer, NeverThrowsException> hashFunction) Creates a new consistent hash map which will hash keys using the provided hash function. -
Uses of Function in org.forgerock.opendj.ldap.schema
Modifier and TypeMethodDescriptionSchemaValidationPolicy.checkDitStructureRulesParentEntryResolver()
Returns the parent entry resolver which should be used for retrieving the parent entry during DIT structure rule validation.Modifier and TypeMethodDescriptionSchemaValidationPolicy.checkDitStructureRules
(SchemaValidationPolicy.Action policy, Function<Dn, Entry, LdapException> parentEntryResolver) Specifies the policy for validating entries against structure rules defined in the schema. -
Uses of Function in org.forgerock.secrets
Modifier and TypeMethodDescription<T,
E extends Exception>
TReveals the secret temporarily, allowing it to be used for its intended purpose.<T,
E extends Exception>
TGenericSecret.revealAndDestroy
(Function<byte[], T, E> function) Reveals the secret temporarily and then scrubs the secret material from memory.<T,
E extends Exception>
TGenericSecret.revealAsText
(Charset charset, Function<char[], T, E> function) Reveals the secret temporarily as characters in the given character set.<T,
E extends Exception>
TGenericSecret.revealAsTextAndDestroy
(Charset charset, Function<char[], T, E> function) Reveals the secret temporarily as characters in the given character set and then scrubs the secret material from memory.<T,
E extends Exception>
TGenericSecret.revealAsUtf8
(Function<char[], T, E> function) Reveals the secret temporarily as characters in UTF-8.<T,
E extends Exception>
TGenericSecret.revealAsUtf8AndDestroy
(Function<char[], T, E> function) Reveals the secret temporarily as characters in UTF-8 and then scrubs the secret from memory. -
Uses of Function in org.forgerock.secrets.credentials
Modifier and TypeMethodDescriptionstatic <T extends Secret>
CredentialPair<T>CredentialPair.credentialPair
(SecretReference<T> secretReference, Function<T, PrincipalAndSecret<T>, NoSuchSecretException> mapper) Factory method to create a new instance ofCredentialPair
from a reference to a secret containing both the principal and secret. -
Uses of Function in org.forgerock.secrets.keystore
Modifier and TypeClassDescriptionfinal class
A loader for theKeyStoreSecretStore
that knows how to load standard PKCS#11 Hardware Security Module (HSM) providers on our supported platforms.ModifierConstructorDescriptionKeyStoreSecretStore
(Function<char[], KeyStore, KeyStoreException> keyStoreLoader, SecretReference<GenericSecret> keyStorePassword) Initialises the keystore using the same password for the keystore and all keys and default configuration options.KeyStoreSecretStore
(Function<char[], KeyStore, KeyStoreException> keyStoreLoader, SecretReference<GenericSecret> keyStorePassword, SecretReference<GenericSecret> keyEntryPassword, Options options, KeyStoreSecretStore.StableIdProvider stableIdProvider) Initialises the key store.KeyStoreSecretStore
(Function<char[], KeyStore, KeyStoreException> keyStoreLoader, SecretReference<GenericSecret> keyStorePassword, Options options) Initialises the keystore using the same password for the keystore and all keys. -
Uses of Function in org.forgerock.util
Modifier and TypeClassDescriptionclass
CloseSilentlyFunction<VIN extends Closeable,
VOUT, E extends Exception> Function
that silently closes an input-parameter after a delegate-function'sapply(Object)
is invoked.Modifier and TypeMethodDescriptionReturns a composed function that first applies this function to its input, and then applies theafter
function to the result.CloseSilentlyFunction.closeSilently
(Function<IN, OUT, EX> delegate) Wraps a delegate function in aCloseSilentlyFunction
.Returns a composed function that first applies thebefore
function to its input, and then applies this function to the result.Function.identity()
Returns an identity function that returns the input as output.Modifier and TypeMethodDescriptionReturns a composed function that first applies this function to its input, and then applies theafter
function to the result.CloseSilentlyFunction.closeSilently
(Function<IN, OUT, EX> delegate) Wraps a delegate function in aCloseSilentlyFunction
.Returns a composed function that first applies thebefore
function to its input, and then applies this function to the result.LambdaExceptionUtils.rethrowFunction
(Function<T, R, E> function) ModifierConstructorDescriptionCloseSilentlyFunction
(Function<VIN, VOUT, E> delegate) Creates a newCloseSilentlyFunction
instance. -
Uses of Function in org.forgerock.util.promise
Modifier and TypeMethodDescriptionstatic <V,
E extends Exception>
Function<NeverThrowsException,V, E> NeverThrowsException.neverThrown()
Utility method returning an empty function, whose goal is to ease the transformation of aPromise
type.Modifier and TypeMethodDescriptionSubmits the provided function for execution once thisPromise
has completed with a result, and returns a newPromise
representing the outcome of the function.Submits the provided functions for execution once thisPromise
has completed (with a result or an exception), and returns a newPromise
representing the outcome of the invoked function.Promise.then
(Function<? super V, VOUT, EOUT> onResult, Function<? super E, VOUT, EOUT> onException, Function<? super RuntimeException, VOUT, EOUT> onRuntimeException) Submits the provided functions for execution once thisPromise
has completed (with a result or an exception or aRuntimeException
), and returns a newPromise
representing the outcome of the invoked function.PromiseImpl.then
(Function<? super V, VOUT, EOUT> onResult, Function<? super E, VOUT, EOUT> onException, Function<? super RuntimeException, VOUT, EOUT> onRuntimeException) Submits the provided function for execution once thisPromise
has not completed with a result (has completed with an exception), and returns a newPromise
representing the outcome of the function.Promise.thenCatchRuntimeException
(Function<? super RuntimeException, V, E> onRuntimeException) Submits the provided function for execution once thisPromise
has not completed with a result nor with an exception but with aRuntimeException
, and returns a newPromise
representing the outcome of the function.PromiseImpl.thenCatchRuntimeException
(Function<? super RuntimeException, V, E> onRuntimeException)
JsonValue::copy
directly instead