Record Class ViewMixin.Converter<V>
java.lang.Object
java.lang.Record
ch.ladestation.connectncharge.util.mvcbase.ViewMixin.Converter<V>
- Enclosing interface:
- ViewMixin<M,
C extends ControllerBase<M>>
-
Constructor Summary
ConstructorsConstructorDescriptionConverter
(ObservableValue<V> observableValue) Creates an instance of aConverter
record class. -
Method Summary
Modifier and TypeMethodDescription<R> ViewMixin.Updater<V,
R> convertedBy
(Function<V, R> converter) Second (optional) step for registering an observer to specify a converter-functionfinal boolean
Indicates whether some other object is "equal to" this one.void
execute
(ObservableValue.ValueChangeListener<V> listener) Registers an observer.final int
hashCode()
Returns a hash code value for this object.Returns the value of theobservableValue
record component.final String
toString()
Returns a string representation of this record class.void
Registers an observer without any type conversion that will keep property-value and observableValue in sync.
-
Constructor Details
-
Converter
Creates an instance of aConverter
record class.- Parameters:
observableValue
- the value for theobservableValue
record component
-
-
Method Details
-
convertedBy
Second (optional) step for registering an observer to specify a converter-function- Type Parameters:
R
-- Parameters:
converter
- the function converting the type of 'ObservableValue' into the type of the 'Property'- Returns:
- an Updater to specify the 'GUI-Property' that needs to be updated if 'ObservableValue' changes
-
update
Registers an observer without any type conversion that will keep property-value and observableValue in sync.- Parameters:
property
- GUI-Property that will be updated when observableValue changes
-
execute
Registers an observer.- Parameters:
listener
- whatever needs to be done on GUI when observableValue changes
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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)
. -
observableValue
Returns the value of theobservableValue
record component.- Returns:
- the value of the
observableValue
record component
-