public abstract class ValidationError<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
extends java.lang.Object
implements java.io.Serializable
Modifier | Constructor and Description |
---|---|
protected |
ValidationError(@NotNull MapModel<G,A,R> mapModel)
Creates a new instance.
|
protected |
ValidationError(@NotNull java.lang.String key,
@NotNull MapModel<G,A,R> mapModel)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addGameObject(G gameObject)
Adds an erroneous
GameObject . |
protected void |
addMapSquare(@NotNull MapSquare<G,A,R> mapSquare)
Adds an erroneous
MapSquare . |
@NotNull java.util.List<G> |
getGameObjects()
Returns the
GameObjects that caused the error. |
@NotNull MapModel<G,A,R> |
getMapModel()
Return the map on which the error occurred.
|
@NotNull java.lang.Iterable<MapSquare<G,A,R>> |
getMapSquares()
Returns the
MapSquares that caused the error. |
@NotNull java.lang.String |
getMessage()
Returns the error message for this validation error.
|
abstract @Nullable java.lang.String |
getParameter(int id)
Returns a parameter string to be used in the error message.
|
@Nullable java.lang.String |
toString()
The String representation of an error is its title.
|
protected ValidationError(@NotNull @NotNull MapModel<G,A,R> mapModel) throws java.lang.IllegalArgumentException
mapModel
- the map model that caused the errorjava.lang.IllegalArgumentException
- in case the validator's name does not
end on "Checker"@NotNull public @NotNull MapModel<G,A,R> getMapModel()
@NotNull public @NotNull java.lang.Iterable<MapSquare<G,A,R>> getMapSquares()
MapSquares
that caused the error.protected void addMapSquare(@NotNull @NotNull MapSquare<G,A,R> mapSquare)
MapSquare
.mapSquare
- the erroneous map square@NotNull public @NotNull java.util.List<G> getGameObjects()
GameObjects
that caused the error.protected void addGameObject(@NotNull G gameObject)
GameObject
.gameObject
- the erroneous game object@Nullable public abstract @Nullable java.lang.String getParameter(int id)
id
}.id
- the error id@NotNull public @NotNull java.lang.String getMessage()
@Nullable public @Nullable java.lang.String toString()
toString
in class java.lang.Object