| File was renamed from sdk/src/org/opends/sdk/Change.java |
| | |
| | | |
| | | |
| | | |
| | | |
| | | import com.sun.opends.sdk.util.Validator; |
| | | |
| | | |
| | |
| | | * <p> |
| | | * TODO: other constructors. |
| | | */ |
| | | public final class Change |
| | | public final class Modification |
| | | { |
| | | private final ModificationType modificationType; |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a new modification having the provided modification type |
| | | * and attribute values to be updated. Note that while the returned |
| | | * {@code Change} is immutable, the underlying attribute may not be. |
| | | * The following code ensures that the returned {@code Change} is |
| | | * fully immutable: |
| | | * Creates a new modification having the provided modification type and |
| | | * attribute values to be updated. Note that while the returned {@code |
| | | * Modification} is immutable, the underlying attribute may not be. The |
| | | * following code ensures that the returned {@code Modification} is fully |
| | | * immutable: |
| | | * |
| | | * <pre> |
| | | * Change change = |
| | | * new Change(modificationType, Types.unmodifiableAttribute(attribute)); |
| | | * Modification change = new Modification(modificationType, Types |
| | | * .unmodifiableAttribute(attribute)); |
| | | * </pre> |
| | | * |
| | | * @param modificationType |
| | | * The type of change to be performed. |
| | | * The type of modification to be performed. |
| | | * @param attribute |
| | | * The the attribute containing the values to be modified. |
| | | */ |
| | | public Change(ModificationType modificationType, Attribute attribute) |
| | | public Modification(final ModificationType modificationType, |
| | | final Attribute attribute) |
| | | { |
| | | Validator.ensureNotNull(modificationType, attribute); |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * Returns the type of change to be performed. |
| | | * |
| | | * @return The type of change to be performed. |
| | | */ |
| | | public ModificationType getModificationType() |
| | | { |
| | | return modificationType; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Returns the attribute containing the values to be modified. |
| | | * |
| | | * @return The the attribute containing the values to be modified. |
| | |
| | | |
| | | |
| | | /** |
| | | * Returns the type of modification to be performed. |
| | | * |
| | | * @return The type of modification to be performed. |
| | | */ |
| | | public ModificationType getModificationType() |
| | | { |
| | | return modificationType; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String toString() |
| | | { |
| | | StringBuilder builder = new StringBuilder(); |
| | | builder.append("Change(modificationType="); |
| | | final StringBuilder builder = new StringBuilder(); |
| | | builder.append("Modification(modificationType="); |
| | | builder.append(modificationType); |
| | | builder.append(", attributeDescription="); |
| | | builder.append(attribute.getAttributeDescriptionAsString()); |
| | | builder.append(", attributeValues={"); |
| | | boolean firstValue = true; |
| | | for (ByteString value : attribute) |
| | | for (final ByteString value : attribute) |
| | | { |
| | | if (!firstValue) |
| | | { |