public class MultiValueProperty<ValueType>
extends java.lang.Object
Constructor and Description |
---|
MultiValueProperty(java.lang.String name,
boolean allowDuplicateValues,
ValueType... values)
Initialize the new instance with a name and define whether or not
duplicate values are allowed.
|
MultiValueProperty(java.lang.String name,
ValueType... values)
Initialize the new instance with a name.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
addValue(ValueType value)
Add the given value to the list of values.
|
boolean |
addValues(ValueType... values)
Add the given values to the list of values.
|
void |
clearValues()
Remove all values;
|
boolean |
containsValue(ValueType value)
Returns true if the given value is already in the list of values.
|
boolean |
equals(java.lang.Object obj)
Returns true if the given object is a MultiValueProperty with the same
name (case-sensitive) as this MultiValueProperty instance.
|
boolean |
getAllowDuplicates() |
ValueType |
getFirstValue()
Returns the first value of the internal list of values or null if no values
are available.
|
java.lang.String |
getName()
Returns the name of this property.
|
protected NamedValue<java.util.List<ValueType>> |
getNamedValues() |
java.util.List<ValueType> |
getValues()
Returns a list of the values.
|
int |
hashCode() |
boolean |
hasValues()
Returns true if at least one value is in the list of values.
|
boolean |
isEmpty()
Returns true if no value is in the list of values.
|
int |
numberOfValues()
Returns the number of values in the list of values,
|
protected boolean |
removeValue(ValueType value)
Remove the given value from the list of values.
|
boolean |
removeValues(ValueType... values)
Remove the given values from the list of values.
|
void |
setAllowDuplicates(boolean newValue) |
protected void |
setNamedValues(NamedValue<java.util.List<ValueType>> newValue) |
public MultiValueProperty(java.lang.String name, ValueType... values)
public MultiValueProperty(java.lang.String name, boolean allowDuplicateValues, ValueType... values)
public java.lang.String getName()
public boolean getAllowDuplicates()
public void setAllowDuplicates(boolean newValue)
public boolean addValues(ValueType... values)
values
- The values to add.public boolean removeValues(ValueType... values)
values
- The values to remove.public boolean containsValue(ValueType value)
public java.util.List<ValueType> getValues()
public ValueType getFirstValue()
public void clearValues()
public boolean isEmpty()
public boolean hasValues()
public int numberOfValues()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
protected boolean addValue(ValueType value)
value
- The value to add.protected boolean removeValue(ValueType value)
value
- The value to remove.protected NamedValue<java.util.List<ValueType>> getNamedValues()
protected void setNamedValues(NamedValue<java.util.List<ValueType>> newValue)