Package ch.nolix.system.element.property
Klasse MutableOptionalValue<V>
java.lang.Object
ch.nolix.system.element.property.AbstractValue<V>
ch.nolix.system.element.property.MutableOptionalValue<V>
- Typparameter:
V- is the type of the value of aMutableOptionalValue.
- Alle implementierten Schnittstellen:
INameHolder,EmptinessRequestable,MutabilityRequestable,IBaseValue,IProperty
- Version:
- 2017-11-01
- Autor:
- Silvan Wyss
-
Feldübersicht
Von Klasse geerbte Felder ch.nolix.system.element.property.AbstractValue
specificationCreator -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected final voidaddOrChangeValue(V value) Adds or change the given value to the currentAbstractValue.voidclear()Removes the value of the currentSingleValue.final voidfillUpAttributesInto(ILinkedList<INode<?>> list) static MutableOptionalValue<Boolean> forBoolean(String name, Consumer<Boolean> setterMethod) static <E extends IElement>
MutableOptionalValue<E> forElement(String name, Consumer<E> setterMethod, Function<INode<?>, E> valueCreator) static MutableOptionalValue<Integer> static MutableOptionalValue<String> final Nodefinal VgetValue()protected final voidRemoves the value of the currentSingleValue.final booleanisEmpty()booleanfinal voidSets the value of the currentSingleValue.Von Klasse geerbte Methoden ch.nolix.system.element.property.AbstractValue
addedOrChangedAttribute, getNameVon Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitVon Schnittstelle geerbte Methoden ch.nolix.coreapi.stateapi.staterequestapi.EmptinessRequestable
containsAnyVon Schnittstelle geerbte Methoden ch.nolix.coreapi.attributeapi.mandatoryattributeapi.INameHolder
getNameInQuotes, hasName, hasSameNameAsVon Schnittstelle geerbte Methoden ch.nolix.coreapi.stateapi.staterequestapi.MutabilityRequestable
isImmutable
-
Konstruktordetails
-
MutableOptionalValue
public MutableOptionalValue(String name, Consumer<V> setterMethod, Function<INode<?>, V> valueCreator, Function<V, INode<?>> specificationCreator) Creates a newMutableOptionalValuewith the given name, setterMethod, valueCreator and specificationCreator.- Parameter:
name-setterMethod-valueCreator-specificationCreator-- Löst aus:
ArgumentIsNullException- if the given name is null.InvalidArgumentException- if the given name is blank.ArgumentIsNullException- if the given valueCreator is null.ArgumentIsNullException- if the given specificationCreator is null.
-
-
Methodendetails
-
forBoolean
- Parameter:
name-setterMethod-- Gibt zurück:
- a new
MutableOptionalValuethat will store aBooleanand have the given name and setterMethod. - Löst aus:
ArgumentIsNullException- if the given name is null.InvalidArgumentException- if the given name is blank.ArgumentIsNullException- if the given setterMethod is null.
-
forElement
public static <E extends IElement> MutableOptionalValue<E> forElement(String name, Consumer<E> setterMethod, Function<INode<?>, E> valueCreator) - Typparameter:
E- is the type of the value of the createdMutableOptionalValue.- Parameter:
name-setterMethod-valueCreator-- Gibt zurück:
- a new
MutableOptionalValuethat will store aIElementand have the given name, setterMethod and valueCreator. - Löst aus:
ArgumentIsNullException- if the given name is null.InvalidArgumentException- if the given name is blank.ArgumentIsNullException- if the given setterMethod is null.ArgumentIsNullException- if the given valueCreator is null.
-
forInt
- Parameter:
name-setterMethod-- Gibt zurück:
- a new
MutableOptionalValuethat will store aIntegerand have the given name and setterMethod. - Löst aus:
ArgumentIsNullException- if the given name is null.InvalidArgumentException- if the given name is blank.ArgumentIsNullException- if the given setterMethod is null.
-
forString
- Parameter:
name-setterMethod-- Gibt zurück:
- a new
MutableOptionalValuethat will store aStringand have the given name and setterMethod. - Löst aus:
ArgumentIsNullException- if the given name is null.InvalidArgumentException- if the given name is blank.ArgumentIsNullException- if the given setterMethod is null.
-
clear
public void clear()Removes the value of the currentSingleValue. -
isMutable
public boolean isMutable()- Gibt zurück:
- true if the current
MutabilityRequestableis mutable.
-
getSpecification
- Gibt zurück:
- a new specification of the current
SingleValue. - Löst aus:
ArgumentDoesNotHaveAttributeException- if the currentSingleValuedoes not have a value
-
getValue
- Gibt zurück:
- the value of the current
SingleValue. - Löst aus:
ArgumentDoesNotHaveAttributeException- if the currentSingleValuedoes not have a value.
-
isEmpty
public final boolean isEmpty()- Gibt zurück:
- true if
EmptinessRequestabledoes not contain an element.
-
setValue
Sets the value of the currentSingleValue.- Parameter:
value-- Löst aus:
ArgumentIsNullException- if the given value is null.InvalidArgumentException- if the currentSingleValueis not mutable and has already a value.
-
addOrChangeValue
Beschreibung aus Klasse kopiert:AbstractValueAdds or change the given value to the currentAbstractValue.- Angegeben von:
addOrChangeValuein KlasseAbstractValue<V>- Parameter:
value-
-
fillUpAttributesInto
-
internalClear
protected final void internalClear()Removes the value of the currentSingleValue.
-