@FunctionalInterface public interface Validator<T>
| 限定符和类型 | 方法和说明 |
|---|---|
default Iterator<Setting<T>> |
settings()
The settings on which the validity of this setting depends.
|
void |
validate(T value)
Validate this setting's value in isolation.
|
default void |
validate(T value,
Map<Setting<T>,T> settings)
Validate this setting against its dependencies, specified by
settings(). |
void validate(T value)
value - the value of this settingdefault void validate(T value, Map<Setting<T>,T> settings)
settings().
The default implementation does nothing, accepting any value as valid as long as
it passes the validation in validate(Object).value - the value of this settingsettings - a map from the settings specified by settings()} to their valuesdefault Iterator<Setting<T>> settings()
validate(Object, Map).
By default this returns an empty iterator, indicating that this setting does not
depend on any other settings.Copyright © 2021. All rights reserved.