Class ProblemPlaceholder
- All Implemented Interfaces:
Identified
A convenient placeholder when constructing a Problem
's args. We try
to pass whole objects to the Problem's args - this leads to consistency in
displaying/translating and makes messages more generic and reusable (see
ObjectRenderer where we display objects in a user-friendly way).
ProblemPlaceholder allows us to code the same Problems/messages regardless of
whether we have an instance of the affected object or not. In many cases we
will have hit an error before we've been able to create the object. E.g.
ProblemPlaceholder('foo', Step.class) will be displayed to the user as "'foo'
step", the same as if we had an actual Step object.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
getId()
Class<? extends Identified>
Class<?>
int
hashCode()
static ProblemPlaceholder
Creates a placeholder object when there is none available, e.g.toString()
-
Constructor Details
-
ProblemPlaceholder
-
-
Method Details
-
getIdentifiedClass
- Specified by:
getIdentifiedClass
in interfaceIdentified
- Returns:
- the class that implements the Identified interface - this should be the API class, and not the implementation class. For example the jython function would return IdentifiedFunction from here, not JythonFunction. The default implementation should be fine for most uses, apart from proxying.
-
toString
-
of
Creates a placeholder object when there is none available, e.g. the problem occurred trying to create the thing of interest.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
getId
- Specified by:
getId
in interfaceIdentified
- Returns:
- id
-
getWrappedClass
-