Package com.dua3.utility.fx.controls
Klasse InputControl.State<R>
java.lang.Object
com.dua3.utility.fx.controls.InputControl.State<R>
- Typparameter:
R- the type of the value being managed
- Umschließende Schnittstelle:
InputControl<T>
State class encapsulates a value, validation logic, error message, and validity state.
-
Eigenschaftsübersicht
EigenschaftenTypEigenschaftBeschreibungReturns a read-only string property representing the current error message.Provides a read-only boolean property indicating the validity state.Returns the property representing the value managed by this State. -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungConstructs a State object with the given value.Constructs a State object with the given value, default value supplier, and validation function.Constructs a State object with the given value and default value supplier. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungReturns a read-only string property representing the current error message.voidreset()Resets the state to its default value.voidsetDefault(Supplier<? extends R> dflt) Sets the default value supplier for this State.voidsetValidate(Function<? super R, Optional<String>> validate) Sets the validation function for the State.Provides a read-only boolean property indicating the validity state.Returns the property representing the value managed by this State.
-
Eigenschaftsdetails
-
value
Returns the property representing the value managed by this State.- Siehe auch:
-
valid
Provides a read-only boolean property indicating the validity state.- Siehe auch:
-
error
Returns a read-only string property representing the current error message. If the value is valid, the error message will be an empty string.- Siehe auch:
-
-
Konstruktordetails
-
State
Constructs a State object with the given value.- Parameter:
value- the property representing the value managed by this State
-
State
Constructs a State object with the given value and default value supplier.- Parameter:
value- the property representing the value managed by this Statedflt- a supplier that provides the default value for the property
-
State
public State(Property<R> value, Supplier<? extends R> dflt, Function<? super R, Optional<String>> validate) Constructs a State object with the given value, default value supplier, and validation function.- Parameter:
value- the property representing the value managed by this Statedflt- a supplier that provides the default value for the propertyvalidate- a function that validates the value and returns an optional error message
-
-
Methodendetails
-
setValidate
Sets the validation function for the State.- Parameter:
validate- a function that validates the value and returns an optional error message
-
valueProperty
Returns the property representing the value managed by this State.- Gibt zurück:
- the property representing the value
-
validProperty
Provides a read-only boolean property indicating the validity state.- Gibt zurück:
- a
ReadOnlyBooleanPropertyrepresenting whether the current state is valid
-
errorProperty
Returns a read-only string property representing the current error message. If the value is valid, the error message will be an empty string.- Gibt zurück:
- ReadOnlyStringProperty representing the error message.
-
setDefault
Sets the default value supplier for this State.- Parameter:
dflt- a supplier that provides the default value for the property
-
reset
public void reset()Resets the state to its default value.This method sets the current value of the property managed by this state to the default value supplied during the creation of the state.
-