NumericTemplate
The trait for generalizing the creation of numeric JsonTemplates.
This trait allows to create a family of traits which represents the states in which a numeric template can be in after specifying some constraint or other. The template starts "empty", meaning that it is able to match all numeric values for its type. Then, a minimum or maximum value can be specified, either inclusive or exclusive. The last constraint allows to specify the missing half part of the interval, leaving the template as "complete" and without further constraints to specify. The interval can be left half-open and its limits can be specified in any order.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
object DoubleTemplate.typeobject FloatTemplate.typetrait IntegralTemplateobject IntTemplate.typeobject LongTemplate.type
Members list
Type members
Classlikes
The "terminal" numeric template, for which no more information can be specified for building a JsonNumericTemplate.
The "terminal" numeric template, for which no more information can be specified for building a JsonNumericTemplate.
This template represents the last stage in building a numeric template, meaning that no more constraints can be specified. The range for the value has already been specified as a minimum and maximum allowed values, either inclusive or exclusive.
Type parameters
- A
-
the actual numeric type for which instantiating this type
Attributes
- Constructor
-
creates a new instance of this trait given the already specified minimum and maximum values and the function that returns a new JsonNumericTemplate from this one
- Supertypes
- Known subtypes
-
class CompleteDoubleTemplateclass CompleteFloatTemplate
The "empty" numeric template, capable of matching any value of the given numeric type.
The "empty" numeric template, capable of matching any value of the given numeric type.
This is the starting template from which creating any other numeric template by specifying more and more constraints. Being so, it is allowed to add a minimum value, either inclusive or exclusive, or a maximum value, either inclusive or exclusive, to create a new template from this.
Type parameters
- A
-
the actual numeric type for which instantiating this type
- B
-
the actual type of the template for which the minimum has been specified
- C
-
the actual type of the template for which the maximum has been specified
- D
-
the actual type of the template for which either the minimum and the maximum have been specified altogether
Attributes
- Constructor
-
creates a new instance of this trait given the function that returns a new template given the minimum, the one that returns a new template given the maximum and the one that returns a new JsonNumericTemplate from this one
- Supertypes
- Known subtypes
-
class EmptyDoubleTemplateclass EmptyFloatTemplate
The numeric template for which the maximum value, either inclusive or exclusive, has been specified.
The numeric template for which the maximum value, either inclusive or exclusive, has been specified.
This template represents one for numerical values where the maximum constraint, whether it be an inclusive or exclusive one, has been specified. Now, only a minimum constraint can be specified, closing the now half-open interval. This is not mandatory to do. This will produce a "complete" template for which no more constraints can be specified.
Type parameters
- A
-
the actual numeric type for which instantiating this type
- B
-
the actual type of the template for which either the minimum and the maximum have been specified altogether
Attributes
- Constructor
-
creates a new instance of this trait given the already specified maximum value, the function that returns a new template given the minimum and the maximum and the one that returns a new JsonNumericTemplate from this one
- Supertypes
- Known subtypes
-
class WithMaximumFloatTemplate
The numeric template for which the minimum value, either inclusive or exclusive, has been specified.
The numeric template for which the minimum value, either inclusive or exclusive, has been specified.
This template represents one for numerical values where the minimum constraint, whether it be an inclusive or exclusive one, has been specified. Now, only a maximum constraint can be specified, closing the now half-open interval. This is not mandatory to do. This will produce a "complete" template for which no more constraints can be specified.
Type parameters
- A
-
the actual numeric type for which instantiating this type
- B
-
the actual type of the template for which either the minimum and the maximum have been specified altogether
Attributes
- Constructor
-
creates a new instance of this trait given the already specified minimum value, the function that returns a new template given the minimum and the maximum and the one that returns a new JsonNumericTemplate from this one
- Supertypes
- Known subtypes
-
class WithMinimumFloatTemplate