Class StoredProperty<T>
java.lang.Object
dev.prozilla.pine.common.property.storage.StoredProperty<T>
- All Implemented Interfaces:
Destructible,MutableObjectProperty<T>,MutableProperty<T>,Property<T>,Functor<T>
- Direct Known Subclasses:
StoredBooleanProperty,StoredFloatProperty,StoredIntProperty,StoredStringProperty
public abstract class StoredProperty<T>
extends Object
implements MutableObjectProperty<T>, Destructible
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Removes the corresponding item from the store.abstract TgetValue()Returns the value of this property.booleanChecks if the value of this property is notnull.booleansetNull()Sets the value of this property tonull.booleanbooleanSets the value of this property.Returns a stored string property with the same key as this property.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.prozilla.pine.common.property.mutable.MutableObjectProperty
stealMethods inherited from interface dev.prozilla.pine.common.property.mutable.MutableProperty
modifyValue, swapValue, viewPropertyMethods inherited from interface dev.prozilla.pine.common.property.Property
getValueOr, hasValue, hasValueProperty, isNotNullProperty, isNull, map, replaceNull, requireValue, snapshot
-
Field Details
-
storage
-
key
-
-
Constructor Details
-
StoredProperty
-
-
Method Details
-
getValue
Description copied from interface:PropertyReturns the value of this property. -
isNotNull
public boolean isNotNull()Description copied from interface:PropertyChecks if the value of this property is notnull. -
setNull
public boolean setNull()Description copied from interface:MutableObjectPropertySets the value of this property tonull.- Specified by:
setNullin interfaceMutableObjectProperty<T>- Returns:
falseif the value of this property was alreadynull.
-
setValue
-
setValue
Description copied from interface:MutablePropertySets the value of this property.- Specified by:
setValuein interfaceMutableProperty<T>- Parameters:
value- The new value- Returns:
trueif the value was changed.
-
destroy
public void destroy()Removes the corresponding item from the store.- Specified by:
destroyin interfaceDestructible
-
toStringProperty
Returns a stored string property with the same key as this property.- Specified by:
toStringPropertyin interfaceProperty<T>- Returns:
- A new stored string property.
- See Also:
-