JsonStringTemplate

io.github.cakelier.tuples.space.JsonTemplate$.JsonStringTemplate
See theJsonStringTemplate companion object
sealed trait JsonStringTemplate extends JsonTemplate

A JsonTemplate that can be matched against a string value.

A JsonElement can be matched using a set of strings, creating what is called in the JSON Schema an "enum". Regardless of this, specifying a Set constrains the values that the JsonElement can have, because no other string value outside of the Set could be accepted. If the Set is the singleton Set, this constraint is perfectly equal to specifying a constant value to be matched against. The given JsonElement can be constrained in terms of an inclusive range of string length, which can be half-open, and in terms of the regular expression that can match it. If no constraint is specified, only the type equality will be checked.

Attributes

Companion
object
Graph
Supertypes
trait JsonTemplate
class Object
trait Matchable
class Any

Members list

Value members

Inherited 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

Inherited from:
JsonTemplate

Abstract fields

The inclusive maximum length of the JsonElement that is to be matched.

The inclusive maximum length of the JsonElement that is to be matched.

Attributes

The inclusive minimum length of the JsonElement that is to be matched.

The inclusive minimum length of the JsonElement that is to be matched.

Attributes

The regular expression matching the JsonElement that is to be matched.

The regular expression matching the JsonElement that is to be matched.

Attributes

The Set of values that the JsonElement can assume when is to be matched.

The Set of values that the JsonElement can assume when is to be matched.

Attributes