JsonTemplate

io.github.cakelier.tuples.space.JsonTemplate
See theJsonTemplate companion object
sealed trait JsonTemplate

A template, also known as an anti-tuple, an entity capable of matching against a tuple.

Being the tuples "JSON" tuples, the templates should be "JSON" templates as well, being capable of matching them. This means that all the available templates are made for covering a different part of the "JSON Schema" specification, the only specification that can produce a JSON document which can be used for checking whether or not another JSON document conforms to it. This means that the JSON Schema allows to create templates for JSON documents, which can be matched against, the corresponding use case for this JSON template. Following the possible underlying representations of a JSON tuple and of an element of the tuple itself, a template can match against a null value, a boolean, an integer, a long integer, a single precision floating point number, a double precision floating point number, a string or a tuple itself. The JSON schema specification allows also for creating templates of templates, where the single templates are used for matching using different semantics. Then it can be possible to match a JSON element if any of the templates matches, if all of the templates matches, if only one of the templates matches. It is also possible to match a template if the inner template does not match.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

def matches(value: JsonElement): Boolean

Returns whether or not the given JsonElement matches this template.

Returns whether or not the given JsonElement matches this template.

Value parameters

value

the JsonElement to match

Attributes

Returns

whether or not the given JsonElement matches