-
public interface ProblemA problem found during the validation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default intcountBranches()Returns the number of branches in this problem.default List<Problem>getBranch(int index)Returns the list of the problems contained in the branch at the specified index.default StringgetContextualMessage()Return the message describing this problem, which includes the location where this problem is found in the input source.StringgetContextualMessage(Locale locale)Return the message describing this problem, which includes the location where this problem is found in the input source.StringgetKeyword()Returns the keyword which provided the assertion.JsonLocationgetLocation()Returns the location where this problem is found in the input source.default StringgetMessage()Return the message describing this problem.StringgetMessage(Locale locale)Return the message describing this problem, which will be localized for the specified locale.StringgetPointer()Returns the JSON pointer where this problem is found in the input source.JsonSchemagetSchema()Returns the JSON schema which provided the assertion.default booleanhasBranches()Checks if this problem has any branches or not.booleanisResolvable()Checks if this problem is resolvable or not.Map<String,?>parametersAsMap()Returns all parameters of this problem as a map.StringtoString()Returns the same string asgetContextualMessage()for the default locale.
-
-
-
Method Detail
-
getMessage
default String getMessage()
Return the message describing this problem.- Returns:
- the message describing this problem, never be
null.
-
getMessage
String getMessage(Locale locale)
Return the message describing this problem, which will be localized for the specified locale.- Parameters:
locale- the locale for which the message will be localized.- Returns:
- the message describing this problem, never be
null. - Throws:
NullPointerException- if the specifiedlocaleisnull.
-
getContextualMessage
default String getContextualMessage()
Return the message describing this problem, which includes the location where this problem is found in the input source.- Returns:
- the message of this problem.
-
getContextualMessage
String getContextualMessage(Locale locale)
Return the message describing this problem, which includes the location where this problem is found in the input source. The message will be localized for the specified locale.- Parameters:
locale- the locale for which the message will be localized.- Returns:
- the message of this problem.
- Throws:
NullPointerException- if the specifiedlocaleisnull.
-
getLocation
JsonLocation getLocation()
Returns the location where this problem is found in the input source.- Returns:
- the location where this problem occurred. This can be
nullif the location is unknown.
-
getPointer
String getPointer()
Returns the JSON pointer where this problem is found in the input source.- Returns:
- the string representation of JSON pointer where this problem
occurred. This can be
nullif the location is unknown. - Since:
- 0.14.0
-
getSchema
JsonSchema getSchema()
Returns the JSON schema which provided the assertion.- Returns:
- the JSON schema which provided the assertion, never be
null.
-
getKeyword
String getKeyword()
Returns the keyword which provided the assertion.- Returns:
- the keyword which provided the assertion. This may be
null.
-
parametersAsMap
Map<String,?> parametersAsMap()
Returns all parameters of this problem as a map.- Returns:
- the map containing all parameters this problem has. The map may be
empty, but never be
null.
-
isResolvable
boolean isResolvable()
Checks if this problem is resolvable or not.- Returns:
trueif this problem can be resolved.falseif this problem is inevitable and cannot be resolved.
-
hasBranches
default boolean hasBranches()
Checks if this problem has any branches or not.- Returns:
trueif this problem has any branhes.falseif this problem does not have any branches.
-
countBranches
default int countBranches()
Returns the number of branches in this problem.- Returns:
- the number of branches.
-
getBranch
default List<Problem> getBranch(int index)
Returns the list of the problems contained in the branch at the specified index.- Parameters:
index- the index of the problem branch.- Returns:
- the unmodifiable list of the problems in the specified index, never
be
null. - Throws:
IndexOutOfBoundsException- if the index is out of range.- See Also:
hasBranches(),countBranches()
-
toString
String toString()
Returns the same string asgetContextualMessage()for the default locale.
-
-