Record Class ConstantValue<T>
java.lang.Object
java.lang.Record
dev.pfaff.altargui.util.listenable.ConstantValue<T>
- All Implemented Interfaces:
Listenable
,ValueListenable<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddListener
(Runnable listener) Adds a listener.addListener
(Consumer<T> listener) Adds a listener.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.<R> ValueListenable
<R> final String
toString()
Returns a string representation of this record class.value()
Returns the value of thevalue
record component.
-
Constructor Details
-
ConstantValue
Creates an instance of aConstantValue
record class.- Parameters:
value
- the value for thevalue
record component
-
-
Method Details
-
addListener
Description copied from interface:Listenable
Adds a listener. The listener may not be added again if already added. When added, it is guaranteed to be invoked immediately.- Specified by:
addListener
in interfaceListenable
- Specified by:
addListener
in interfaceValueListenable<T>
-
addListener
Description copied from interface:ValueListenable
Adds a listener. The listener may not be added again if already added. When added, it is guaranteed to be invoked immediately with the current value.- Specified by:
addListener
in interfaceValueListenable<T>
-
map
- Specified by:
map
in interfaceValueListenable<T>
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
value
Returns the value of thevalue
record component.- Returns:
- the value of the
value
record component
-