mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Matthew Swift
22.18.2016 9bdba2b5de74b9cdb94b809bebbda7465243ecb9
opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/SimplePropertyMapper.java
@@ -34,7 +34,6 @@
import org.forgerock.opendj.ldap.schema.CoreSchema;
import org.forgerock.services.context.Context;
import org.forgerock.util.Function;
import org.forgerock.util.promise.NeverThrowsException;
import org.forgerock.util.promise.Promise;
import static java.util.Collections.*;
@@ -47,8 +46,8 @@
/** An property mapper which provides a simple mapping from a JSON value to a single LDAP attribute. */
public final class SimplePropertyMapper extends AbstractLdapPropertyMapper<SimplePropertyMapper> {
    private Function<ByteString, ?, NeverThrowsException> decoder;
    private Function<Object, ByteString, NeverThrowsException> encoder;
    private Function<ByteString, ?, ? extends Exception> decoder;
    private Function<Object, ByteString, ? extends Exception> encoder;
    SimplePropertyMapper(final AttributeDescription ldapAttributeName) {
        super(ldapAttributeName);
@@ -62,7 +61,7 @@
     *            The function to use for decoding LDAP attribute values.
     * @return This property mapper.
     */
    public SimplePropertyMapper decoder(final Function<ByteString, ?, NeverThrowsException> f) {
    public SimplePropertyMapper decoder(final Function<ByteString, ?, ? extends Exception> f) {
        this.decoder = f;
        return this;
    }
@@ -99,7 +98,7 @@
     *            The function to use for encoding LDAP attribute values.
     * @return This property mapper.
     */
    public SimplePropertyMapper encoder(final Function<Object, ByteString, NeverThrowsException> f) {
    public SimplePropertyMapper encoder(final Function<Object, ByteString, ? extends Exception> f) {
        this.encoder = f;
        return this;
    }
@@ -193,11 +192,11 @@
        }
    }
    private Function<ByteString, ?, NeverThrowsException> decoder() {
    private Function<ByteString, ?, ? extends Exception> decoder() {
        return decoder == null ? byteStringToJson(ldapAttributeName) : decoder;
    }
    private Function<Object, ByteString, NeverThrowsException> encoder() {
    private Function<Object, ByteString, ? extends Exception> encoder() {
        return encoder == null ? jsonToByteString(ldapAttributeName) : encoder;
    }