| | |
| | | |
| | | import org.opends.sdk.ByteString; |
| | | |
| | | import com.sun.opends.sdk.util.StaticUtils; |
| | | |
| | | |
| | | |
| | | /** |
| | | * An abstract Intermediate response which can be used as the basis for |
| | | * implementing new Intermediate responses. |
| | | * |
| | | * |
| | | * @param <S> |
| | | * The type of Intermediate response. |
| | | */ |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public abstract String getResponseName(); |
| | | public abstract String getOID(); |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public abstract ByteString getResponseValue(); |
| | | public abstract ByteString getValue(); |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public abstract boolean hasValue(); |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String toString() |
| | | { |
| | | final StringBuilder builder = new StringBuilder(); |
| | | builder.append("IntermediateResponse(responseName="); |
| | | builder.append(getResponseName() == null ? "" : getResponseName()); |
| | | builder.append(", responseValue="); |
| | | final ByteString value = getResponseValue(); |
| | | builder.append(value == null ? ByteString.empty() : value); |
| | | builder.append(getOID() == null ? "" : getOID()); |
| | | if (hasValue()) |
| | | { |
| | | builder.append(", responseValue="); |
| | | StaticUtils.toHexPlusAscii(getValue(), builder, 4); |
| | | } |
| | | builder.append(", controls="); |
| | | builder.append(getControls()); |
| | | builder.append(")"); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | @SuppressWarnings("unchecked") |
| | | final S getThis() |
| | | { |