| | |
| | | super(name, description, isRequired, isMultiValued, requiresAdminAction); |
| | | |
| | | |
| | | activeValues = new ArrayList<String>(); |
| | | activeValues = new ArrayList<>(); |
| | | pendingValues = activeValues; |
| | | } |
| | | |
| | |
| | | |
| | | if (value == null) |
| | | { |
| | | activeValues = new ArrayList<String>(); |
| | | activeValues = new ArrayList<>(); |
| | | } |
| | | else |
| | | { |
| | | activeValues = new ArrayList<String>(1); |
| | | activeValues = new ArrayList<>(1); |
| | | activeValues.add(value); |
| | | } |
| | | |
| | |
| | | |
| | | if (activeValues == null) |
| | | { |
| | | this.activeValues = new ArrayList<String>(); |
| | | this.activeValues = new ArrayList<>(); |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | if (requiresAdminAction()) |
| | | { |
| | | pendingValues = new ArrayList<String>(1); |
| | | pendingValues = new ArrayList<>(1); |
| | | pendingValues.add(value); |
| | | setPendingValues(getValueSet(value)); |
| | | } |
| | |
| | | if (requiresAdminAction()) |
| | | { |
| | | setPendingValues(new LinkedHashSet<ByteString>(0)); |
| | | pendingValues = new ArrayList<String>(); |
| | | pendingValues = new ArrayList<>(); |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | // Iterate through all the provided values, make sure that they are |
| | | // acceptable, and build the value set. |
| | | LinkedHashSet<ByteString> valueSet = new LinkedHashSet<ByteString>(numValues); |
| | | LinkedHashSet<ByteString> valueSet = new LinkedHashSet<>(numValues); |
| | | for (String value : values) |
| | | { |
| | | if ((value == null) || (value.length() == 0)) |
| | |
| | | */ |
| | | private static LinkedHashSet<ByteString> getValueSet(String value) |
| | | { |
| | | LinkedHashSet<ByteString> valueSet = new LinkedHashSet<ByteString>(1); |
| | | LinkedHashSet<ByteString> valueSet = new LinkedHashSet<>(1); |
| | | valueSet.add(ByteString.valueOf(value)); |
| | | return valueSet; |
| | | } |
| | |
| | | return null; |
| | | } |
| | | |
| | | LinkedHashSet<ByteString> valueSet = new LinkedHashSet<ByteString>(values.size()); |
| | | LinkedHashSet<ByteString> valueSet = new LinkedHashSet<>(values.size()); |
| | | for (String value : values) |
| | | { |
| | | valueSet.add(ByteString.valueOf(value)); |
| | |
| | | } |
| | | else |
| | | { |
| | | return new LinkedHashSet<ByteString>(); |
| | | return new LinkedHashSet<>(); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | LinkedHashSet<ByteString> valueSet = new LinkedHashSet<ByteString>(numValues); |
| | | LinkedHashSet<ByteString> valueSet = new LinkedHashSet<>(numValues); |
| | | for (String valueString : valueStrings) |
| | | { |
| | | if ((valueString == null) || (valueString.length() == 0)) |
| | |
| | | else |
| | | { |
| | | // This is fine. The pending value set can be empty. |
| | | pendingValues = new ArrayList<String>(0); |
| | | pendingValues = new ArrayList<>(0); |
| | | } |
| | | } |
| | | else |
| | |
| | | throw new ConfigException(message); |
| | | } |
| | | |
| | | pendingValues = new ArrayList<String>(numValues); |
| | | pendingValues = new ArrayList<>(numValues); |
| | | for (ByteString v : a) |
| | | { |
| | | pendingValues.add(v.toString()); |
| | |
| | | else |
| | | { |
| | | // This is fine. The active value set can be empty. |
| | | activeValues = new ArrayList<String>(0); |
| | | activeValues = new ArrayList<>(0); |
| | | } |
| | | } |
| | | else |
| | |
| | | throw new ConfigException(message); |
| | | } |
| | | |
| | | activeValues = new ArrayList<String>(numValues); |
| | | activeValues = new ArrayList<>(numValues); |
| | | for (ByteString v : a) |
| | | { |
| | | activeValues.add(v.toString()); |
| | |
| | | { |
| | | try |
| | | { |
| | | ArrayList<String> values = new ArrayList<String>(length); |
| | | ArrayList<String> values = new ArrayList<>(length); |
| | | |
| | | for (int i=0; i < length; i++) |
| | | { |