Modifier and Type | Method and Description |
---|---|
static AttributeDescription |
byteStringToAttributeDescription(ByteString value,
Schema schema)
Parses a
ByteString as an AttributeDescription using the provided schema. |
static Function<ByteString,Boolean,LocalizedIllegalArgumentException> |
byteStringToBoolean()
Returns a function which parses
Boolean values. |
static X509Certificate |
byteStringToCertificate(ByteString value)
Parses a
ByteString as a X509Certificate . |
static Function<ByteString,Dn,LocalizedIllegalArgumentException> |
byteStringToDn()
Returns a function which parses
DN s using the default schema. |
static Function<ByteString,Dn,LocalizedIllegalArgumentException> |
byteStringToDn(Schema schema)
Returns a function which parses
DN s using the provided schema. |
static Function<ByteString,GeneralizedTime,LocalizedIllegalArgumentException> |
byteStringToGeneralizedTime()
Returns a function which parses generalized time strings.
|
static Function<ByteString,Integer,LocalizedIllegalArgumentException> |
byteStringToInteger()
Returns a function which parses
Integer string values. |
static Function<ByteString,Long,LocalizedIllegalArgumentException> |
byteStringToLong()
Returns a function which parses
Long string values. |
static <M,N> Function<M,N,NeverThrowsException> |
constant(N constant)
Creates a function that returns constant value for any input.
|
static <M> M |
identity(M value)
Returns the provided value.
|
static boolean |
stringToBoolean(String value)
Parses a
String as a boolean . |
static int |
stringToInteger(String value)
Parses a
String as an int . |
static long |
stringToLong(String value)
Parses a
String as a long . |
public static <M,N> Function<M,N,NeverThrowsException> constant(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> M identity(M value)
M
- The type of value returned by this function.value
- The value to be returned.public static boolean stringToBoolean(String value)
String
as a boolean
. The method will accept the values 0
, false
, no
, off
, 1
, true
, yes
, on
. All other values will result
in a LocalizedIllegalArgumentException
.value
- The value to be parsed.boolean
.public static int stringToInteger(String value)
String
as an int
. Invalid values will result in a LocalizedIllegalArgumentException
.value
- The value to be parsed.int
.public static long stringToLong(String value)
String
as a long
. Invalid values will result in a LocalizedIllegalArgumentException
.value
- The value to be parsed.long
.public static AttributeDescription byteStringToAttributeDescription(ByteString value, Schema schema)
ByteString
as an AttributeDescription
using the provided schema. Invalid values will
result in a LocalizedIllegalArgumentException
.value
- The value to be parsed.schema
- The schema to use for decoding attribute descriptions.AttributeDescription
s.public static Function<ByteString,Boolean,LocalizedIllegalArgumentException> byteStringToBoolean()
Boolean
values. The function will accept the values 0
, false
, no
, off
, 1
, true
, yes
, on
. All other values will result
in a LocalizedIllegalArgumentException
.Boolean
values.public static Function<ByteString,Dn,LocalizedIllegalArgumentException> byteStringToDn()
DN
s using the default schema. Invalid values will result in a LocalizedIllegalArgumentException
.DN
s.public static Function<ByteString,Dn,LocalizedIllegalArgumentException> 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 X509Certificate byteStringToCertificate(ByteString value)
ByteString
as a X509Certificate
. Invalid values will result in a LocalizedIllegalArgumentException
.value
- The value to be parsed.X509Certificate
.public static Function<ByteString,GeneralizedTime,LocalizedIllegalArgumentException> byteStringToGeneralizedTime()
LocalizedIllegalArgumentException
.public static Function<ByteString,Integer,LocalizedIllegalArgumentException> byteStringToInteger()
Integer
string values. Invalid
values will result in a LocalizedIllegalArgumentException
.Integer
string values.public static Function<ByteString,Long,LocalizedIllegalArgumentException> byteStringToLong()
Long
string values. Invalid
values will result in a LocalizedIllegalArgumentException
.Long
string values.Copyright 2010-2022 ForgeRock AS.