public abstract class AbstractValidator<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends java.lang.Object implements Validator<G,A,R>
Validator
but does not declare it to force subclasses to choose the interface to
implement.Modifier | Constructor and Description |
---|---|
protected |
AbstractValidator(@NotNull ValidatorPreferences validatorPreferences)
Creates a new instance.
|
protected |
AbstractValidator(@NotNull ValidatorPreferences validatorPreferences,
@NotNull java.lang.String key)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
@NotNull java.lang.String |
getKey()
Get a Key that uniquely identifies this Validator.
|
boolean |
isDefaultEnabled()
Get whether this Validator should be enabled per default.
|
boolean |
isEnabled()
Get whether this Validator is enabled.
|
void |
setEnabled(boolean enabled)
Set whether this Validator should be enabled.
|
protected AbstractValidator(@NotNull @NotNull ValidatorPreferences validatorPreferences) throws java.lang.IllegalArgumentException
validatorPreferences
- the validator preferences to usejava.lang.IllegalArgumentException
- in case the validator's name does not
end on "Checker".protected AbstractValidator(@NotNull @NotNull ValidatorPreferences validatorPreferences, @NotNull @NotNull java.lang.String key)
validatorPreferences
- the validator preferences to usekey
- Key@NotNull public @NotNull java.lang.String getKey()
Validator
public void setEnabled(boolean enabled)
Validator
setEnabled
in interface Validator<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
enabled
- true
if this validator should be enabled,
otherwise false
public boolean isEnabled()
Validator
public boolean isDefaultEnabled()
Validator
isDefaultEnabled
in interface Validator<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>