| | |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | * Portions copyright 2012 ForgeRock AS. |
| | | */ |
| | | package org.forgerock.opendj.ldap.controls; |
| | | |
| | |
| | | * If {@code control} was {@code null}. |
| | | */ |
| | | public static GenericControl newControl(final Control control) |
| | | throws NullPointerException |
| | | { |
| | | Validator.ensureNotNull(control); |
| | | |
| | |
| | | * If {@code oid} was {@code null}. |
| | | */ |
| | | public static GenericControl newControl(final String oid) |
| | | throws NullPointerException |
| | | { |
| | | return new GenericControl(oid, false, null); |
| | | } |
| | |
| | | * If {@code oid} was {@code null}. |
| | | */ |
| | | public static GenericControl newControl(final String oid, |
| | | final boolean isCritical) throws NullPointerException |
| | | final boolean isCritical) |
| | | { |
| | | return new GenericControl(oid, isCritical, null); |
| | | } |
| | |
| | | * If {@code oid} was {@code null}. |
| | | */ |
| | | public static GenericControl newControl(final String oid, |
| | | final boolean isCritical, final Object value) throws NullPointerException |
| | | final boolean isCritical, final Object value) |
| | | { |
| | | return new GenericControl(oid, isCritical, (value == null) ? null |
| | | : ByteString.valueOf(value)); |