java.lang.Object
java.lang.Record
com.dua3.utility.fx.ValidationResult
- Datensatzkomponenten:
control- the control the result belongs tolevel- theLevelmessage- the message
public record ValidationResult(Control control, ValidationResult.Level level, String message)
extends Record
Represents the result of a validation process performed on a Control.
Contains information about the control being validated, the level of validation result, and an optional message.
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic enumEnum representing the level of a validation result. -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungValidationResult(Control control, ValidationResult.Level level, String message) Erstellt eine Instanz einer DatensatzklasseValidationResult. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungcontrol()Gibt den Wert für die Datensatzkomponentecontrolzurück.final booleanGibt an, ob ein anderes Objekt diesem gleich ("equal to") ist.static ValidationResultCreates aValidationResultindicating an error for the specified control, with the given error message.final inthashCode()Gibt einen Hashcodewert für diese Objekt zurück.booleanisOk()Determines if the ValidationResult level is OK.level()Gibt den Wert für die Datensatzkomponentelevelzurück.merge(ValidationResult other) Merges thisValidationResultwith anotherValidationResult.message()Gibt den Wert für die Datensatzkomponentemessagezurück.static ValidationResultCreates a ValidationResult with an OK level and an empty message for the given control.final StringtoString()Gibt eine Zeichenfolgendarstellung dieser Datensatzklasse zurück.
-
Konstruktordetails
-
Methodendetails
-
ok
Creates a ValidationResult with an OK level and an empty message for the given control.- Parameter:
c- the control for which the validation result is being created- Gibt zurück:
- a
ValidationResultindicating an OK level for the given control
-
error
Creates aValidationResultindicating an error for the specified control, with the given error message.- Parameter:
c- the control associated with the validation errormessage- the error message describing the validation failure- Gibt zurück:
- a
ValidationResultindicating an error with the given message
-
isOk
public boolean isOk()Determines if the ValidationResult level is OK.- Gibt zurück:
- true if the validation level is OK, otherwise false.
-
merge
Merges thisValidationResultwith anotherValidationResult. If either result is OK, the other result is returned. If both results are errors, a new result is created combining the error messages.- Parameter:
other- theValidationResultto merge with this result- Gibt zurück:
- a new
ValidationResultthat represents the combined result of the merge
-
toString
Gibt eine Zeichenfolgendarstellung dieser Datensatzklasse zurück. Die Darstellung enthält den Namen der Klasse, gefolgt vom Namen und Wert jeder der Datensatzkomponenten. -
hashCode
public final int hashCode()Gibt einen Hashcodewert für diese Objekt zurück. Der Wert wird vom Hashcode jeder der Datensatzkomponenten abgeleitet. -
equals
Gibt an, ob ein anderes Objekt diesem gleich ("equal to") ist. Die Objekte sind gleich, wenn das andere Objekt der gleichen Klasse angehört und alle Datensatzkomponenten gleich sind. Alle Komponenten in dieser Datensatzklasse werden verglichen mitObjects::equals(Object,Object). -
control
Gibt den Wert für die Datensatzkomponentecontrolzurück.- Gibt zurück:
- Wert der Datensatzkomponente
control
-
level
Gibt den Wert für die Datensatzkomponentelevelzurück.- Gibt zurück:
- Wert der Datensatzkomponente
level
-
message
Gibt den Wert für die Datensatzkomponentemessagezurück.- Gibt zurück:
- Wert der Datensatzkomponente
message
-