public final class SimplePropertyMapper extends PropertyMapper
| Modifier and Type | Method and Description |
|---|---|
SimplePropertyMapper |
decoder(org.forgerock.util.Function<org.forgerock.opendj.ldap.ByteString,?,? extends Exception> f)
Sets the decoder which will be used for converting LDAP attribute values
to JSON values.
|
SimplePropertyMapper |
defaultJsonValue(Object defaultValue)
Sets the default JSON value which should be substituted when the LDAP attribute is not found in the LDAP entry.
|
SimplePropertyMapper |
defaultJsonValues(Collection<?> defaultValues)
Sets the default JSON values which should be substituted when the LDAP attribute is not found in the LDAP entry.
|
SimplePropertyMapper |
encoder(org.forgerock.util.Function<Object,org.forgerock.opendj.ldap.ByteString,? extends Exception> f)
Sets the encoder which will be used for converting JSON values to LDAP
attribute values.
|
SimplePropertyMapper |
isBinary(boolean isBinary)
Indicates that JSON values are base 64 encodings of binary data.
|
T |
isMultiValued(boolean isMultiValued)
Indicates that the LDAP attribute is multi-valued and should be represented in JSON using an array of values.
|
T |
isRequired(boolean isRequired)
Indicates that the LDAP attribute is mandatory and must be provided during create requests.
|
SimplePropertyMapper |
jsonSchema(org.forgerock.json.JsonValue jsonSchema)
Sets the JSON schema corresponding to this simple property mapper.
|
static void |
putTypeAndFormat(org.forgerock.json.JsonValue jsonSchema,
org.forgerock.opendj.ldap.schema.AttributeType attrType)
Puts the type and format corresponding to the provided attribute type on the provided JSON
schema.
|
static void |
putWritabilityProperties(WritabilityPolicy writabilityPolicy,
org.forgerock.json.JsonValue jsonSchema) |
String |
toString() |
T |
writability(WritabilityPolicy policy)
Indicates whether the LDAP attribute supports updates.
|
public SimplePropertyMapper decoder(org.forgerock.util.Function<org.forgerock.opendj.ldap.ByteString,?,? extends Exception> f)
f - The function to use for decoding LDAP attribute values.public SimplePropertyMapper defaultJsonValue(Object defaultValue)
defaultValue - The default JSON value.public SimplePropertyMapper defaultJsonValues(Collection<?> defaultValues)
defaultValues - The default JSON values.public SimplePropertyMapper encoder(org.forgerock.util.Function<Object,org.forgerock.opendj.ldap.ByteString,? extends Exception> f)
f - The function to use for encoding LDAP attribute values.public SimplePropertyMapper isBinary(boolean isBinary)
true is equivalent to the following:
mapper.decoder(...); // function that converts binary data to base 64 mapper.encoder(...); // function that converts base 64 to binary dataPassing in a value of
false resets the encoding and decoding
functions to the default.isBinary - true if this property is binary.public SimplePropertyMapper jsonSchema(org.forgerock.json.JsonValue jsonSchema)
null,
it will be returned by toJsonSchema(), otherwise a default JSON schema will be
automatically generated with the information available in this property mapper.jsonSchema - the JSON schema corresponding to this simple property mapper. Can be nullpublic static void putTypeAndFormat(org.forgerock.json.JsonValue jsonSchema,
org.forgerock.opendj.ldap.schema.AttributeType attrType)
jsonSchema - the JSON schema where to put the type and formatattrType - the attribute type for which to infer JSON the type and formatpublic final T isRequired(boolean isRequired)
isRequired - true if this property is required.public final T isMultiValued(boolean isMultiValued)
isMultiValued - true if this property is multi-valued.public final T writability(WritabilityPolicy policy)
WritabilityPolicy.READ_WRITE.policy - The writability policy.public static void putWritabilityProperties(WritabilityPolicy writabilityPolicy, org.forgerock.json.JsonValue jsonSchema)
Copyright © 2017-2020 Wren Security. All Rights Reserved.