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

org.ldaptive.io.AbstractPrimitiveValueTranscoder Maven / Gradle / Ivy

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

/**
 * Base class for primitive value transcoders.
 *
 * @param    type of object to transcode
 *
 * @author  Middleware Services
 */
public abstract class AbstractPrimitiveValueTranscoder extends AbstractStringValueTranscoder
{

  /** Whether this transcoder operates on a primitive or an object. */
  private boolean primitive;


  /**
   * Returns whether this transcoder operates on a primitive value.
   *
   * @return  whether this transcoder operates on a primitive value
   */
  public boolean isPrimitive()
  {
    return primitive;
  }


  /**
   * Sets whether this transcoder operates on a primitive value.
   *
   * @param  b  whether this transcoder operates on a primitive value
   */
  public void setPrimitive(final boolean b)
  {
    primitive = b;
  }


  @Override
  public String encodeStringValue(final T value)
  {
    return value.toString();
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy