Klasse OptionalValue<V>
java.lang.Object
ch.nolix.system.element.property.AbstractValue<V>
ch.nolix.system.element.property.OptionalValue<V>
- Typparameter:
V- is the type of the value of aOptionalValue.
- Alle implementierten Schnittstellen:
INameHolder, EmptinessRequestable, MutabilityRequestable, IBaseValue, IProperty
- Autor:
- Silvan Wyss
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifikator und TypMethodeBeschreibungfinal voidfillUpAttributesInto(ILinkedList<INode<?>> list) static OptionalValue<Boolean> forBoolean(String name, Consumer<Boolean> setterMethod) static OptionalValue<Double> static OptionalValue<Integer> static OptionalValue<String> final Nodefinal VgetValue()final booleanisEmpty()booleanfinal voidSets the value of the currentAbstractSingleValue.Von Klasse geerbte Methoden AbstractValue
addedOrChangedAttribute, getNameVon Klasse geerbte Methoden Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitVon Schnittstelle geerbte Methoden EmptinessRequestable
containsAnyVon Schnittstelle geerbte Methoden INameHolder
getNameInQuotes, hasName, hasSameNameAsVon Schnittstelle geerbte Methoden MutabilityRequestable
isImmutable
-
Konstruktordetails
-
OptionalValue
public OptionalValue(String name, Consumer<V> setterMethod, Function<INode<?>, V> valueCreator, Function<V, INode<?>> specificationCreator) Creates a newOptionalValuewith 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
OptionalValuethat 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.
-
forDouble
- Parameter:
name-setterMethod-- Gibt zurück:
- a new
OptionalValuethat will store aDoubleand 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.
-
forInt
- Parameter:
name-setterMethod-- Gibt zurück:
- a new
OptionalValuethat 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
OptionalValuethat 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.
-
isMutable
public boolean isMutable()- Gibt zurück:
- true if the current
MutabilityRequestableis mutable, false otherwise.
-
getSpecification
- Gibt zurück:
- a new specification of the current
AbstractSingleValue. - Löst aus:
ArgumentDoesNotHaveAttributeException- if the currentAbstractSingleValuedoes not have a value
-
getValue
- Gibt zurück:
- the value of the current
AbstractSingleValue. - Löst aus:
ArgumentDoesNotHaveAttributeException- if the currentAbstractSingleValuedoes not have a value.
-
isEmpty
public final boolean isEmpty()- Gibt zurück:
- true if
EmptinessRequestabledoes not contain an element, false otherwise.
-
setValue
Sets the value of the currentAbstractSingleValue.- Parameter:
value-- Löst aus:
ArgumentIsNullException- if the given value is null.InvalidArgumentException- if the currentAbstractSingleValueis not mutable and has already a value.
-
fillUpAttributesInto
-