Modifier and Type | Method and Description |
---|---|
static Function<ByteString,AttributeDescription,NeverThrowsException> |
byteStringToAttributeDescription()
Returns a function which parses
AttributeDescription s using the
default schema. |
static Function<ByteString,AttributeDescription,NeverThrowsException> |
byteStringToAttributeDescription(Schema schema)
Returns a function which parses
AttributeDescription s using the
provided schema. |
static Function<ByteString,Boolean,NeverThrowsException> |
byteStringToBoolean()
Returns a function which parses
Boolean values. |
static Function<ByteString,DN,NeverThrowsException> |
byteStringToDN()
Returns a function which parses
DN s using the default schema. |
static Function<ByteString,DN,NeverThrowsException> |
byteStringToDN(Schema schema)
Returns a function which parses
DN s using the provided schema. |
static Function<ByteString,GeneralizedTime,NeverThrowsException> |
byteStringToGeneralizedTime()
Returns a function which parses generalized time strings.
|
static Function<ByteString,Integer,NeverThrowsException> |
byteStringToInteger()
Returns a function which parses
Integer string values. |
static Function<ByteString,Long,NeverThrowsException> |
byteStringToLong()
Returns a function which parses
Long string values. |
static Function<ByteString,String,NeverThrowsException> |
byteStringToString()
Returns a function which parses a
ByteString as a UTF-8 encoded
String . |
static <M,X,N> Function<M,N,NeverThrowsException> |
compose(Function<M,X,NeverThrowsException> first,
Function<X,N,NeverThrowsException> second)
Returns the composition of two functions.
|
static <M> Function<M,M,NeverThrowsException> |
identityFunction()
Returns a function which always returns the value that it was provided
with.
|
static Function<String,String,NeverThrowsException> |
normalizeString()
Returns a function which converts a
String to lower case using
StaticUtils.toLowerCase(org.forgerock.opendj.ldap.ByteSequence, java.lang.StringBuilder) and then trims it. |
static Function<Object,ByteString,NeverThrowsException> |
objectToByteString()
Returns a function which converts an
Object to a
ByteString using the ByteString.valueOfObject(Object) method. |
static <M,N> Function<M,N,NeverThrowsException> |
returns(N constant)
Creates a function that returns constant value for any input.
|
static Function<String,AttributeDescription,NeverThrowsException> |
stringToAttributeDescription()
Returns a function which parses
AttributeDescription s using the
default schema. |
static Function<String,AttributeDescription,NeverThrowsException> |
stringToAttributeDescription(Schema schema)
Returns a function which parses
AttributeDescription s using the
provided schema. |
static Function<String,Boolean,NeverThrowsException> |
stringToBoolean()
Returns a function which parses
Boolean values. |
static Function<String,DN,NeverThrowsException> |
stringToDN()
Returns a function which parses
DN s using the default schema. |
static Function<String,DN,NeverThrowsException> |
stringToDN(Schema schema)
Returns a function which parses
DN s using the provided schema. |
static Function<String,GeneralizedTime,NeverThrowsException> |
stringToGeneralizedTime()
Returns a function which parses generalized time strings.
|
static Function<String,Integer,NeverThrowsException> |
stringToInteger()
Returns a function which parses
Integer string values. |
static Function<String,Long,NeverThrowsException> |
stringToLong()
Returns a function which parses
Long string values. |
public static <M,N> Function<M,N,NeverThrowsException> returns(N constant)
M
- The type of input values transformed by this function.N
- The type of output values returned by this function.constant
- The constant value for the function to returnpublic static <M,X,N> Function<M,N,NeverThrowsException> compose(Function<M,X,NeverThrowsException> first, Function<X,N,NeverThrowsException> second)
M
- The type of input values transformed by this function.N
- The type of output values returned by this function.X
- The type of intermediate values passed between the two
functions.first
- The first function which will consume the input.second
- The second function which will produce the result.public static <M> Function<M,M,NeverThrowsException> identityFunction()
M
- The type of values transformed by this function.public static Function<String,String,NeverThrowsException> normalizeString()
String
to lower case using
StaticUtils.toLowerCase(org.forgerock.opendj.ldap.ByteSequence, java.lang.StringBuilder)
and then trims it.String
to lower case using
StaticUtils.toLowerCase(org.forgerock.opendj.ldap.ByteSequence, java.lang.StringBuilder)
and then trims it.public static Function<Object,ByteString,NeverThrowsException> objectToByteString()
Object
to a
ByteString
using the ByteString.valueOfObject(Object)
method.Object
to a
ByteString
.public static Function<String,AttributeDescription,NeverThrowsException> stringToAttributeDescription()
AttributeDescription
s using the
default schema. Invalid values will result in a
LocalizedIllegalArgumentException
.AttributeDescription
s.public static Function<String,AttributeDescription,NeverThrowsException> stringToAttributeDescription(Schema schema)
AttributeDescription
s using the
provided schema. Invalid values will result in a
LocalizedIllegalArgumentException
.schema
- The schema to use for decoding attribute descriptions.AttributeDescription
s.public static Function<String,Boolean,NeverThrowsException> stringToBoolean()
Boolean
values. The function will
accept the values 0
, false
, no
, off
,
1
, true
, yes
, on
. All other values will
result in a NumberFormatException
.Boolean
values.public static Function<String,DN,NeverThrowsException> stringToDN()
DN
s using the default schema.
Invalid values will result in a LocalizedIllegalArgumentException
.DN
s.public static Function<String,DN,NeverThrowsException> stringToDN(Schema schema)
DN
s using the provided schema.
Invalid values will result in a LocalizedIllegalArgumentException
.schema
- The schema to use for decoding DNs.DN
s.public static Function<String,GeneralizedTime,NeverThrowsException> stringToGeneralizedTime()
LocalizedIllegalArgumentException
.public static Function<String,Integer,NeverThrowsException> stringToInteger()
Integer
string values. Invalid
values will result in a LocalizedIllegalArgumentException
.Integer
string values.public static Function<String,Long,NeverThrowsException> stringToLong()
Long
string values. Invalid
values will result in a LocalizedIllegalArgumentException
.Long
string values.public static Function<ByteString,AttributeDescription,NeverThrowsException> byteStringToAttributeDescription()
AttributeDescription
s using the
default schema. Invalid values will result in a
LocalizedIllegalArgumentException
.AttributeDescription
s.public static Function<ByteString,AttributeDescription,NeverThrowsException> byteStringToAttributeDescription(Schema schema)
AttributeDescription
s using the
provided schema. Invalid values will result in a
LocalizedIllegalArgumentException
.schema
- The schema to use for decoding attribute descriptions.AttributeDescription
s.public static Function<ByteString,Boolean,NeverThrowsException> byteStringToBoolean()
Boolean
values. The function will
accept the values 0
, false
, no
, off
,
1
, true
, yes
, on
. All other values will
result in a NumberFormatException
.Boolean
values.public static Function<ByteString,DN,NeverThrowsException> byteStringToDN()
DN
s using the default schema.
Invalid values will result in a LocalizedIllegalArgumentException
.DN
s.public static Function<ByteString,DN,NeverThrowsException> byteStringToDN(Schema schema)
DN
s using the provided schema.
Invalid values will result in a LocalizedIllegalArgumentException
.schema
- The schema to use for decoding DNs.DN
s.public static Function<ByteString,GeneralizedTime,NeverThrowsException> byteStringToGeneralizedTime()
LocalizedIllegalArgumentException
.public static Function<ByteString,Integer,NeverThrowsException> byteStringToInteger()
Integer
string values. Invalid
values will result in a LocalizedIllegalArgumentException
.Integer
string values.public static Function<ByteString,Long,NeverThrowsException> byteStringToLong()
Long
string values. Invalid
values will result in a LocalizedIllegalArgumentException
.Long
string values.public static Function<ByteString,String,NeverThrowsException> byteStringToString()
ByteString
as a UTF-8 encoded
String
.ByteString
as a UTF-8 encoded String
.Copyright 2010-2017 ForgeRock AS.