Package jsonvalues.spec
Interface JsSpec
-
- All Known Subinterfaces:
JsArraySpec
- All Known Implementing Classes:
JsArrayOfJsObjSpec
,JsObjSpec
,JsTupleSpec
public interface JsSpec
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isRequired()
Returns whether the key is optional.JsSpec
nullable()
Returns the same spec with the nullable flag enabledJsSpec
optional()
Returns the same spec with the optional flag enabledJsSpecParser
parser()
Returns the deserializer used during the parsing process to parse an array of bytes or stringjava.util.Set<JsErrorPair>
test(JsPath parentPath, JsValue value)
verify if the given value satisfy this spec.
-
-
-
Method Detail
-
isRequired
boolean isRequired()
Returns whether the key is optional.- Returns:
- whether the key is optional.
-
nullable
JsSpec nullable()
Returns the same spec with the nullable flag enabled- Returns:
- the same spec with the nullable flag enabled
-
optional
JsSpec optional()
Returns the same spec with the optional flag enabled- Returns:
- the same spec with the optional flag enabled
-
parser
JsSpecParser parser()
Returns the deserializer used during the parsing process to parse an array of bytes or string- Returns:
- the deserializer used during the parsing process to parse an array of bytes or string into a json value
-
test
java.util.Set<JsErrorPair> test(JsPath parentPath, JsValue value)
verify if the given value satisfy this spec.- Parameters:
parentPath
- the path where the tested value is located.value
- the tested value- Returns:
- a set of path/error pairs
-
-