All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ldaptive.transcode.AbstractBinaryValueTranscoder Maven / Gradle / Ivy

There is a newer version: 2.4.1
Show newest version
/* See LICENSE for licensing and NOTICE for copyright. */
package org.ldaptive.transcode;

import org.ldaptive.LdapUtils;

/**
 * Value transcoder which decodes and encodes to a byte array and therefore the string methods simply delegate to the
 * binary methods.
 *
 * @param    type of object to transcode
 *
 * @author  Middleware Services
 */
public abstract class AbstractBinaryValueTranscoder implements ValueTranscoder
{


  @Override
  public T decodeStringValue(final String value)
  {
    return decodeBinaryValue(LdapUtils.utf8Encode(value));
  }


  @Override
  public String encodeStringValue(final T value)
  {
    return LdapUtils.utf8Encode(encodeBinaryValue(value));
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy