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

matthew_swift
28.47.2010 f2160f4bd1c8ac67e5a86a6710d431e8932877f9
sdk/src/org/opends/sdk/responses/AbstractUnmodifiableResponseImpl.java
@@ -29,20 +29,24 @@
import org.opends.sdk.controls.Control;
import java.util.Collections;
import java.util.List;
import com.sun.opends.sdk.util.Iterables;
import org.opends.sdk.DecodeException;
import org.opends.sdk.DecodeOptions;
import org.opends.sdk.controls.Control;
import org.opends.sdk.controls.ControlDecoder;
/**
 * Unmodifiable response implementation.
 *
 *
 * @param <S>
 *          The type of response.
 */
abstract class AbstractUnmodifiableResponseImpl<S extends Response>
    implements Response
abstract class AbstractUnmodifiableResponseImpl<S extends Response> implements
    Response
{
  private final S impl;
@@ -51,12 +55,11 @@
  /**
   * Creates a new unmodifiable response implementation.
   *
   *
   * @param impl
   *          The underlying response implementation to be made
   *          unmodifiable.
   *          The underlying response implementation to be made unmodifiable.
   */
  AbstractUnmodifiableResponseImpl(S impl)
  AbstractUnmodifiableResponseImpl(final S impl)
  {
    this.impl = impl;
  }
@@ -66,7 +69,7 @@
  /**
   * {@inheritDoc}
   */
  public final S addControl(Control control)
  public final S addControl(final Control control)
      throws UnsupportedOperationException, NullPointerException
  {
    throw new UnsupportedOperationException();
@@ -77,21 +80,12 @@
  /**
   * {@inheritDoc}
   */
  public final S clearControls() throws UnsupportedOperationException
  {
    throw new UnsupportedOperationException();
  }
  /**
   * {@inheritDoc}
   */
  public final Control getControl(String oid)
      throws NullPointerException
  public final <C extends Control> C getControl(
      final ControlDecoder<C> decoder, final DecodeOptions options)
      throws NullPointerException, DecodeException
  {
    // FIXME: ensure that controls are immutable.
    return impl.getControl(oid);
    return impl.getControl(decoder, options);
  }
@@ -99,10 +93,10 @@
  /**
   * {@inheritDoc}
   */
  public final Iterable<Control> getControls()
  public final List<Control> getControls()
  {
    // FIXME: ensure that controls are immutable.
    return Iterables.unmodifiable(impl.getControls());
    return Collections.unmodifiableList(impl.getControls());
  }
@@ -110,27 +104,7 @@
  /**
   * {@inheritDoc}
   */
  public final boolean hasControls()
  {
    return impl.hasControls();
  }
  /**
   * {@inheritDoc}
   */
  public final Control removeControl(String oid)
      throws UnsupportedOperationException, NullPointerException
  {
    throw new UnsupportedOperationException();
  }
  /**
   * {@inheritDoc}
   */
  @Override
  public final String toString()
  {
    return impl.toString();