| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.forgerock.opendj.config.dsconfig; |
| | | |
| | |
| | | |
| | | private PropertyDefinition<T> propertyDefinition; |
| | | private Type type; |
| | | private SortedSet<T> values; |
| | | private SortedSet<T> originalValues; |
| | | private final SortedSet<T> values; |
| | | private final SortedSet<T> originalValues; |
| | | |
| | | /** |
| | | * The private constructor of the PropertyEditorModification. |
| | |
| | | SortedSet<T> originalValues) { |
| | | this.propertyDefinition = propertyDefinition; |
| | | this.type = type; |
| | | this.values = new TreeSet<T>(values); |
| | | this.originalValues = new TreeSet<T>(originalValues); |
| | | this.values = new TreeSet<>(values); |
| | | this.originalValues = new TreeSet<>(originalValues); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | static <T> PropertyEditorModification<T> createResetModification(PropertyDefinition<T> propertyDefinition, |
| | | SortedSet<T> originalValues) { |
| | | return new PropertyEditorModification<T>(propertyDefinition, Type.RESET, new TreeSet<T>(propertyDefinition), |
| | | return new PropertyEditorModification<>(propertyDefinition, Type.RESET, new TreeSet<T>(propertyDefinition), |
| | | originalValues); |
| | | } |
| | | |
| | |
| | | */ |
| | | static <T> PropertyEditorModification<T> createAddModification(PropertyDefinition<T> propertyDefinition, |
| | | SortedSet<T> addedValues, SortedSet<T> originalValues) { |
| | | return new PropertyEditorModification<T>(propertyDefinition, Type.ADD, addedValues, originalValues); |
| | | return new PropertyEditorModification<>(propertyDefinition, Type.ADD, addedValues, originalValues); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | static <T> PropertyEditorModification<T> createSetModification(PropertyDefinition<T> propertyDefinition, |
| | | SortedSet<T> newValues, SortedSet<T> originalValues) { |
| | | return new PropertyEditorModification<T>(propertyDefinition, Type.SET, newValues, originalValues); |
| | | return new PropertyEditorModification<>(propertyDefinition, Type.SET, newValues, originalValues); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | static <T> PropertyEditorModification<T> createRemoveModification(PropertyDefinition<T> propertyDefinition, |
| | | SortedSet<T> removedValues, SortedSet<T> originalValues) { |
| | | return new PropertyEditorModification<T>(propertyDefinition, Type.REMOVE, removedValues, originalValues); |
| | | return new PropertyEditorModification<>(propertyDefinition, Type.REMOVE, removedValues, originalValues); |
| | | } |
| | | |
| | | /** |
| | | * Retuns the property definition associated with this modification. |
| | | * Returns the property definition associated with this modification. |
| | | * |
| | | * @return the property definition associated with this modification. |
| | | */ |