Class MultiValue<V>
java.lang.Object
ch.nolix.system.property.value.AbstractValue<V>
ch.nolix.system.property.value.MultiValue<V>
- Type Parameters:
V- is the type of the values of aMultiValue.
- All Implemented Interfaces:
INameHolder, Clearable, EmptinessRequestable, MaterializationRequestable, IProperty, IBaseValue, IMultiValue<V>
- Author:
- Silvan Wyss
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the given value to the currentIMultiValue.voidclear()Removes the elements of the currentClearable.voidfillUpAttributesIntoList(ILinkedList<INode<?>> list) Fills up the attributes of the currentIPropertyinto the given list.static <E extends IElement>
MultiValue<E> forElementsWithNameAndSetterAndValueMapper(String name, Consumer<E> adder, Function<INode<?>, E> valueMapper) static MultiValue<Integer> forIntsWithNameAndAdder(String name, Consumer<Integer> adder) static MultiValue<String> forStringsWithNameAndAdder(String name, Consumer<String> adder) booleanisEmpty()voidremoveAllOccurrencesOfValue(V value) Removes all occurrences of the given value from the currentIMultiValue.Methods inherited from class AbstractValue
addedOrChangedAttribute, getName, isMaterializedMethods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EmptinessRequestable
containsAnyMethods inherited from interface INameHolder
getName, getNameInQuotes, hasName, hasSameNameAsMethods inherited from interface IProperty
addedOrChangedAttributeMethods inherited from interface MaterializationRequestable
isMaterialized, isView
-
Method Details
-
forElementsWithNameAndSetterAndValueMapper
public static <E extends IElement> MultiValue<E> forElementsWithNameAndSetterAndValueMapper(String name, Consumer<E> adder, Function<INode<?>, E> valueMapper) - Type Parameters:
E- is the type of the values of aMultiValue.- Parameters:
name-adder-valueMapper-- Returns:
- a new
MultiValuewith the given name, setter and valueMapperand and that can storeIElements. - Throws:
RuntimeException- if the given name is null or blank.RuntimeException- if the given adder is null.RuntimeException- if the given valueMapper is null.
-
forIntsWithNameAndAdder
- Parameters:
name-adder-- Returns:
- a new
MultiValuewith the given name and adder and that can storeIntegers. - Throws:
RuntimeException- if the given name is null or blank.RuntimeException- if the given adder is null.
-
forStringsWithNameAndAdder
- Parameters:
name-adder-- Returns:
- a new
MultiValuewith the given name and adder and that can storeStrings. - Throws:
RuntimeException- if the given name is null or blank.RuntimeException- if the given adder is null.
-
addValue
Adds the given value to the currentIMultiValue.- Specified by:
addValuein interfaceIMultiValue<V>- Parameters:
value-
-
clear
-
fillUpAttributesIntoList
Fills up the attributes of the currentIPropertyinto the given list.- Specified by:
fillUpAttributesIntoListin interfaceIProperty- Parameters:
list-
-
getStoredValues
- Specified by:
getStoredValuesin interfaceIMultiValue<V>- Returns:
- the values of the current
IMultiValue.
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceEmptinessRequestable- Returns:
- true if
EmptinessRequestabledoes not contain an element, false otherwise.
-
removeAllOccurrencesOfValue
Removes all occurrences of the given value from the currentIMultiValue.- Specified by:
removeAllOccurrencesOfValuein interfaceIMultiValue<V>- Parameters:
value-
-