public class CaseInsensitiveMultiValueProperties<ValueType> extends java.lang.Object implements IReadOnlyNamedValues<java.util.List<ValueType>>
Constructor and Description |
---|
CaseInsensitiveMultiValueProperties()
Initialize the new instance with default values (allowDuplicateValues=false).
|
CaseInsensitiveMultiValueProperties(boolean allowDuplicateValues)
Initialize the new instance with a flag that specifies whether or not to
allow duplicate values.
|
Modifier and Type | Method and Description |
---|---|
void |
addValues(java.lang.String name,
ValueType... values)
Add one or more values to the property with the given name.
|
void |
clear()
Removes all hold data.
|
void |
clearValues(java.lang.String name) |
boolean |
contains(java.lang.String name) |
protected java.util.Map<java.lang.String,MultiValueProperty<ValueType>> |
createEmptyMap() |
boolean |
getAllowDuplicates() |
java.util.Set<java.lang.String> |
getNames()
Returns the names of all properties held in this container.
|
protected MultiValueProperty<ValueType> |
getOrCreate(java.lang.String name) |
protected java.util.Map<java.lang.String,MultiValueProperty<ValueType>> |
getProperties() |
MultiValueProperty<ValueType> |
getProperty(java.lang.String name)
Returns the property with the given name or null if not found.
|
java.util.List<ValueType> |
getValue(java.lang.String name)
Returns the values of the specified property or null if not found.
|
java.util.List<ValueType> |
getValues(java.lang.String name)
Returns the values of the specified property or null if not found.
|
boolean |
isEmpty()
Returns true if the receiver does not contain any data.
|
void |
remove(java.lang.String... names) |
void |
removeValues(java.lang.String name,
ValueType... values) |
protected void |
setAllowDuplicates(boolean newValue) |
protected void |
setProperties(java.util.Map<java.lang.String,MultiValueProperty<ValueType>> newValue) |
int |
size() |
public CaseInsensitiveMultiValueProperties()
public CaseInsensitiveMultiValueProperties(boolean allowDuplicateValues)
public java.util.Set<java.lang.String> getNames()
getNames
in interface IReadOnlyNamedValues<java.util.List<ValueType>>
public boolean getAllowDuplicates()
public MultiValueProperty<ValueType> getProperty(java.lang.String name)
public java.util.List<ValueType> getValues(java.lang.String name)
name
- The propertie's name (must not be null).public java.util.List<ValueType> getValue(java.lang.String name)
getValue
in interface IReadOnlyNamedValues<java.util.List<ValueType>>
name
- The propertie's name (must not be null).public void addValues(java.lang.String name, ValueType... values)
name
- The name of the property (must not be null)values
- The values to be added - may be omitted completely (must not be null)public boolean contains(java.lang.String name)
public void remove(java.lang.String... names)
public void removeValues(java.lang.String name, ValueType... values)
public void clearValues(java.lang.String name)
public void clear()
public boolean isEmpty()
IReadOnlyNamedValues
isEmpty
in interface IReadOnlyNamedValues<java.util.List<ValueType>>
public int size()
protected MultiValueProperty<ValueType> getOrCreate(java.lang.String name)
protected java.util.Map<java.lang.String,MultiValueProperty<ValueType>> createEmptyMap()
protected java.util.Map<java.lang.String,MultiValueProperty<ValueType>> getProperties()
protected void setProperties(java.util.Map<java.lang.String,MultiValueProperty<ValueType>> newValue)
protected void setAllowDuplicates(boolean newValue)