Companion object to the JsonTuple trait, containing its factory methods and its implementations.
Attributes
Members list
Type members
Classlikes
A non-empty JSON tuple, representing a generic tuple containing at least one element.
A non-empty JSON tuple, representing a generic tuple containing at least one element.
This implementation represents a tuple with at least one element, which is built element by element exploiting the "constructor" operator. Because the JSON tuple is a recursively defined data structure, the at-least-one defined element must be the one in its head, while its tail can be a JsonNil, if the tuple contains exactly one element, or another non-empty JSON tuple otherwise. This enables the recursion of this data structure.
Value parameters
- h
-
the head of this non-empty JSON tuple, which is its first element
- t
-
the tail of this non-empty JSON tuple, which contains all the remaining elements in order
Attributes
- Supertypes
An empty JSON tuple, which could be seen also as a terminator for a JSON tuple definition.
An empty JSON tuple, which could be seen also as a terminator for a JSON tuple definition.
For all data structures recursively defined, this represents the "base case" of the recursive definition, the empty tuple which signals that no more elements needs to be expected. So it has a meaning used on its own, representing an empty tuple, but also can be used for ending a definition of a tuple with a syntax such as
val tuple = 0 #: true #: "hello" #: JsonNil
Attributes
- Supertypes
- Self type
-
JsonNil.type
Inherited types
The names of the product elements
The names of the product elements
Attributes
- Inherited from:
- Mirror
The name of the type
The name of the type
Attributes
- Inherited from:
- Mirror
Value members
Concrete methods
Creates a new non-empty JSON tuple consisting of only one element.
Creates a new non-empty JSON tuple consisting of only one element.
Value parameters
- v
-
the element which is the one and only making this JSON tuple
Attributes
- Returns
-
a new non-empty JSON tuple made only of one element
Creates a new JSON tuple given the variable number of elements passed to it. If no elements are passed, an empty JSON tuple is created, a non-empty JSON tuple otherwise.
Creates a new JSON tuple given the variable number of elements passed to it. If no elements are passed, an empty JSON tuple is created, a non-empty JSON tuple otherwise.
Value parameters
- vs
-
the variable number of elements to be used for creating a new JSON tuple
Attributes
- Returns
-
a new JSON tuple consisting of the given elements, in the same order they were passed
Creates a new JSON tuple from a Seq, keeping the same order of the elements as in the Seq. If an empty sequence is given, an empty tuple will be returned, a non-empty JSON tuple otherwise.
Creates a new JSON tuple from a Seq, keeping the same order of the elements as in the Seq. If an empty sequence is given, an empty tuple will be returned, a non-empty JSON tuple otherwise.
Value parameters
- vs
-
the Seq which elements are to be used for building a new JSON tuple
Attributes
- Returns
-
a new JSON tuple consisting of the same elements of the given Seq in the same order