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

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

The newest version!
/* See LICENSE for licensing and NOTICE for copyright. */
package org.ldaptive.transcode;

/**
 * Decodes and encodes a short for use in an ldap attribute value.
 *
 * @author  Middleware Services
 */
public class ShortValueTranscoder extends AbstractPrimitiveValueTranscoder
{


  /** Default constructor. */
  public ShortValueTranscoder() {}


  /**
   * Creates a new short value transcoder.
   *
   * @param  b  whether this transcoder is operating on a primitive
   */
  public ShortValueTranscoder(final boolean b)
  {
    setPrimitive(b);
  }


  @Override
  public Short decodeStringValue(final String value)
  {
    return Short.valueOf(value);
  }


  @Override
  public Class getType()
  {
    return isPrimitive() ? short.class : Short.class;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy