A base trait for an entity that provides human-readable information about a field (or no field) within a case class.
A base trait for a user-defined value-class that standardizes the name of the value-class val to "underlying" and toString to underlying toString.
A base trait for a user-defined value-class that standardizes the name of the value-class val to "underlying" and toString to underlying toString. This allows creating a conversion from an instance of any value-class to its underlying representation.
For details on value-class see: http://docs.scala-lang.org/overviews/core/value-classes.html
Example value-class: implicit class Name(underlying: String) extends AnyVal with IsValueType[String]
Note1: When using creating a value-class for String, it is necessary to create an implicit view to StringOps to use the Scala extended String methods on instances of the value-class. Example for Name above: object Name { import scala.collection.immutable.StringOps implicit def stringOps_Name(n: Name) = new StringOps(n.underlying) }
Note2: while almost every method on underlying can be used on the value-class without special code, the equals method is a special case that still requires wrapping the right-hand type in the value-class to match the other side. Ex:
Name("Hal") == "Hal" // always returns false + compiler warning Name("Hal") == Name("Hal") // works correctly
type of underlying value class (Note: this parameter does not require inheritance from AnyVal since this would prevent using the trait with java.lang.String which does not inherit AnyVal)
A description of a constraint on the value of a field
A description of a constraint on the value of a field
field path
human readable description e.g. "must be between (0,150)"
A schema that describes the type and cardinality of a field
A schema that describes the type and cardinality of a field
field path
class tag name e.g. "java.lang.String" or "Int"
a tuple of the minimum and maximum number of elements allowed for the field. Common cardinalities: (1,1) => single value (0,1) => optional value (0,Int.MaxValue) => collection
A type-class for validating instances of a type
A type-class for validating instances of a type
type validated
A base trait for an entity that provides human-readable information about a field (or no field) within a case class. A field path is used to point at which field within the "context" the information is associated with. Ex: case class A(i: Int) case class B(a: A)
Field path for the i field of A from within B: "a" :: "i" :: Nil
Field path of i from within context of A: "i" :: Nil
Field path used to "this" (for A or B): Nil