Package ch.nolix.system.element.property
Klasse MutableValue<V>
java.lang.Object
ch.nolix.system.element.property.BaseValue<V>
ch.nolix.system.element.property.MutableValue<V>
- Typparameter:
V
- is the type of the value of aMutableValue
.
- Alle implementierten Schnittstellen:
INameHolder
,EmptinessRequestable
,MutabilityRequestable
,IBaseValue
,IProperty
- Version:
- 2018-03-01
- Autor:
- Silvan Wyss
-
Feldübersicht
Von Klasse geerbte Felder ch.nolix.system.element.property.BaseValue
specificationCreator
-
Konstruktorübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected final void
addOrChangeValue
(V value) Adds or change the given value to the currentBaseValue
.final void
fillUpAttributesInto
(ILinkedList<INode<?>> list) static MutableValue
<Boolean> forBoolean
(String name, boolean defaultValue, Consumer<Boolean> setterMethod) static MutableValue
<Double> static MutableValue
<Integer> static MutableValue
<String> final Node
final V
getValue()
protected final void
Removes the value of the currentSingleValue
.final boolean
isEmpty()
boolean
final void
Sets the value of the currentSingleValue
.Von Klasse geerbte Methoden ch.nolix.system.element.property.BaseValue
addedOrChangedAttribute, getName
Von Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.nolix.coreapi.stateapi.staterequestapi.EmptinessRequestable
containsAny
Von Schnittstelle geerbte Methoden ch.nolix.coreapi.attributeapi.mandatoryattributeapi.INameHolder
getNameInQuotes, hasName, hasSameNameAs
Von Schnittstelle geerbte Methoden ch.nolix.coreapi.stateapi.staterequestapi.MutabilityRequestable
isImmutable
-
Konstruktordetails
-
MutableValue
public MutableValue(String name, V defaultValue, Consumer<V> setterMethod, Function<INode<?>, V> valueCreator, Function<V, INode<?>> specificationCreator) Creates a newMutableValue
with the given name, defaultValue, setterMethod, valueCreator and specificationCreator.- Parameter:
name
-defaultValue
-setterMethod
-valueCreator
-specificationCreator
-- Löst aus:
ArgumentIsNullException
- if the given name is null.InvalidArgumentException
- if the given name is blank.ArgumentIsNullException
- if the given defaultValue is null.ArgumentIsNullException
- if the given setterMethod is null.ArgumentIsNullException
- if the given valueCreator is null.ArgumentIsNullException
- if the given specificationCreator is null.
-
-
Methodendetails
-
forBoolean
public static MutableValue<Boolean> forBoolean(String name, boolean defaultValue, Consumer<Boolean> setterMethod) - Parameter:
name
-defaultValue
-setterMethod
-- Gibt zurück:
- a new
MutableValue
that will store aBoolean
and have the given name, defaultValue 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
public static MutableValue<Double> forDouble(String name, double defaultValue, Consumer<Double> setterMethod) - Parameter:
name
-defaultValue
-setterMethod
-- Gibt zurück:
- a new
MutableValue
that will store aDouble
and have the given name, defaultValue 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
public static MutableValue<Integer> forInt(String name, int defaultValue, Consumer<Integer> setterMethod) - Parameter:
name
-defaultValue
-setterMethod
-- Gibt zurück:
- a new
MutableValue
that will store aInteger
and have the given name, defaultValue 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
public static MutableValue<String> forString(String name, String defaultValue, Consumer<String> setterMethod) - Parameter:
name
-defaultValue
-setterMethod
-- Gibt zurück:
- a new
MutableValue
that will store aString
and have the given name, defaultValue 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
MutabilityRequestable
is mutable.
-
getSpecification
- Gibt zurück:
- a new specification of the current
SingleValue
. - Löst aus:
ArgumentDoesNotHaveAttributeException
- if the currentSingleValue
does not have a value
-
getValue
- Gibt zurück:
- the value of the current
SingleValue
. - Löst aus:
ArgumentDoesNotHaveAttributeException
- if the currentSingleValue
does not have a value.
-
isEmpty
public final boolean isEmpty()- Gibt zurück:
- true if
EmptinessRequestable
does 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 currentSingleValue
is not mutable and has already a value.
-
addOrChangeValue
Beschreibung aus Klasse kopiert:BaseValue
Adds or change the given value to the currentBaseValue
.- Angegeben von:
addOrChangeValue
in KlasseBaseValue<V>
- Parameter:
value
-
-
fillUpAttributesInto
-
internalClear
protected final void internalClear()Removes the value of the currentSingleValue
.
-