Class NullProperty<T>
java.lang.Object
dev.prozilla.pine.common.property.fixed.NullProperty<T>
- All Implemented Interfaces:
FixedProperty<T>,Property<T>,Functor<T>
A property whose value is always
null.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetValue()Returnsnull.getValueOr(T defaultValue) Returns thedefaultValue, because the value of this property is alwaysnull.booleanReturnsfalse, because the value of this property is alwaysnull.replaceNull(Color defaultValue) replaceNull(String defaultValue) replaceNull(T defaultValue) Returns a property whose value is the value of this property, ordefaultValueif the value of this property isnull.snapshot()Returns this property, because its value is always the same, so it is effectively the same as a snapshot.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.fixed.FixedProperty
hasValueProperty, isNotNullProperty, map, toStringPropertyMethods inherited from interface dev.prozilla.pine.common.property.Property
hasValue, isNull, requireValue
-
Constructor Details
-
NullProperty
public NullProperty()
-
-
Method Details
-
getValueOr
Returns thedefaultValue, because the value of this property is alwaysnull.- Specified by:
getValueOrin interfaceProperty<T>- Parameters:
defaultValue- The value to return- Returns:
- The
defaultValue.
-
getValue
Returnsnull. -
isNotNull
@Contract("-> false") public boolean isNotNull()Returnsfalse, because the value of this property is alwaysnull. -
snapshot
Description copied from interface:FixedPropertyReturns this property, because its value is always the same, so it is effectively the same as a snapshot. -
replaceNull
-
replaceNull
-
replaceNull
Description copied from interface:PropertyReturns a property whose value is the value of this property, ordefaultValueif the value of this property isnull.- Specified by:
replaceNullin interfaceFixedProperty<T>- Specified by:
replaceNullin interfaceProperty<T>- Returns:
- A property whose value is never
null.
-