Interface Constraint<T>
- Type Parameters:
T- the type this constraint validates
public interface Constraint<T>
A validation constraint that can check if a value is valid.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if this constraint should fail fast.booleanChecks if the value is valid.@NotNull StringGets the error message for an invalid value.default @Nullable StringsuggestedFix(T value) Gets an optional suggested fix for the invalid value.
-
Method Details
-
isValid
Checks if the value is valid.- Parameters:
value- the value to check- Returns:
- true if valid
-
message
Gets the error message for an invalid value.- Parameters:
value- the invalid value- Returns:
- the error message
-
isFailFast
boolean isFailFast()Checks if this constraint should fail fast.- Returns:
- true if validation failure should prevent plugin loading
-
suggestedFix
Gets an optional suggested fix for the invalid value.- Parameters:
value- the invalid value- Returns:
- the suggested fix, or null
-