object Validator extends ValidatorMacros

Linear Supertypes
ValidatorMacros, AnyRef, scala.Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Validator
  2. ValidatorMacros
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class All[T](validators: Seq[Validator[T]]) extends Validator[T] with Product with Serializable
  2. case class Any[T](validators: Seq[Validator[T]]) extends Validator[T] with Product with Serializable
  3. case class Custom[T](validationLogic: (T) ⇒ ValidationResult, showMessage: Option[String] = None) extends Primitive[T] with Product with Serializable
  4. type EncodeToRaw[T] = (T) ⇒ Option[scala.Any]
  5. case class Enumeration[T](possibleValues: List[T], encode: Option[EncodeToRaw[T]], name: Option[SName]) extends Primitive[T] with Product with Serializable
  6. case class Mapped[TT, T](wrapped: Validator[T], g: (TT) ⇒ T) extends Validator[TT] with Product with Serializable
  7. case class Max[T](value: T, exclusive: Boolean)(implicit valueIsNumeric: Numeric[T]) extends Primitive[T] with Product with Serializable
  8. case class MaxLength[T <: String](value: Int, countCodePoints: Boolean) extends Primitive[T] with Product with Serializable
  9. case class MaxSize[T, C[_] <: Iterable[_]](value: Int) extends Primitive[C[T]] with Product with Serializable
  10. case class Min[T](value: T, exclusive: Boolean)(implicit valueIsNumeric: Numeric[T]) extends Primitive[T] with Product with Serializable
  11. case class MinLength[T <: String](value: Int, countCodePoints: Boolean) extends Primitive[T] with Product with Serializable
  12. case class MinSize[T, C[_] <: Iterable[_]](value: Int) extends Primitive[C[T]] with Product with Serializable
  13. case class Pattern[T <: String](value: String) extends Primitive[T] with Product with Serializable
  14. sealed trait Primitive[T] extends Validator[T]

Value Members

  1. final def !=(arg0: scala.Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: scala.Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def all[T](v: Validator[T]*): Validator[T]
  5. def any[T](v: Validator[T]*): Validator[T]
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  8. def custom[T](validationLogic: (T) ⇒ ValidationResult, showMessage: Option[String] = None): Validator[T]

    Create a custom validator.

    Create a custom validator.

    validationLogic

    The logic of the validator

    showMessage

    Description of the validator used when invoking Validator.show.

  9. macro def derivedEnumeration[T]: Enumeration[T]

    Creates an enum validator where all subtypes of the sealed hierarchy T are object s.

    Creates an enum validator where all subtypes of the sealed hierarchy T are object s. This enumeration will only be used for documentation, as a value outside of the allowed values will not be decoded in the first place (the decoder has no other option than to fail).

    Definition Classes
    ValidatorMacros
  10. def enumeration[T](possibleValues: List[T], encode: EncodeToRaw[T], name: Option[SName] = None): Enumeration[T]

    Create an enumeration validator, with the given possible values, an optional encoding function (so that the enumerated values can be represented in documentation), and an optional name (to create a reusable documentation component).

    Create an enumeration validator, with the given possible values, an optional encoding function (so that the enumerated values can be represented in documentation), and an optional name (to create a reusable documentation component).

    encode

    Specify how values of this type can be encoded to a raw value, which will be used for documentation.

  11. def enumeration[T](possibleValues: List[T]): Enumeration[T]

    Create an enumeration validator, with the given possible values.

    Create an enumeration validator, with the given possible values.

    To represent the enumerated values in documentation, an encoding function needs to be provided. This can be done:

    • by using the overloaded enumeration method with an encode parameter
    • by adding an encode function on an Validator.Enumeration instance using one of the .encode functions
    • by adding the validator directly to a codec (see Mapping.addEncodeToEnumValidator)
    • when the values possible values are of a basic type (numbers, strings), the encode function is inferred if not present, when being added to the schema, see Schema.validate
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: scala.Any): Boolean
    Definition Classes
    AnyRef → Any
  14. def fixedLength[T <: String](value: Int, countCodePoints: Boolean): Validator[T]

    Create a validator for fixed length constraints on strings.

    Create a validator for fixed length constraints on strings.

    value

    The fixed allowed length.

    countCodePoints

    A boolean parameter that determines whether the validation will consider code points or character count. When set to true, the validator will consider characters that are represented using two code units (a surrogate pair) in UTF-16 encoding allowing for a more accurate length validation for strings containing such characters (like emojis). Defaults to false, where length is validated based on the number of Char values in the string.

  15. def fixedLength[T <: String](value: Int): Validator[T]

    Create a validator for fixed length constraints on strings.

    Create a validator for fixed length constraints on strings.

    value

    The fixed allowed length.

  16. def fixedSize[T, C[_] <: Iterable[_]](value: Int): Validator[C[T]]
  17. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  18. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  19. def inRange[T](min: T, max: T, minExclusive: Boolean = false, maxExclusive: Boolean = false)(implicit arg0: Numeric[T]): Validator[T]
  20. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  21. def max[T](value: T, exclusive: Boolean = false)(implicit arg0: Numeric[T]): Primitive[T]
  22. def maxLength[T <: String](value: Int, countCodePoints: Boolean): Primitive[T]

    Create a validator for maximum length constraints on strings.

    Create a validator for maximum length constraints on strings.

    value

    The maximum allowed length.

    countCodePoints

    A boolean parameter that determines whether the validation will consider code points or character count. When set to true, the validator will consider characters that are represented using two code units (a surrogate pair) in UTF-16 encoding allowing for a more accurate length validation for strings containing such characters (like emojis). Defaults to false, where length is validated based on the number of Char values in the string.

  23. def maxLength[T <: String](value: Int): Primitive[T]

    Create a validator for maximum length constraints on strings.

    Create a validator for maximum length constraints on strings.

    value

    The maximum allowed length.

  24. def maxSize[T, C[_] <: Iterable[_]](value: Int): Primitive[C[T]]
  25. def min[T](value: T, exclusive: Boolean = false)(implicit arg0: Numeric[T]): Primitive[T]
  26. def minLength[T <: String](value: Int, countCodePoints: Boolean): Primitive[T]

    Create a validator for minimum length constraints on strings.

    Create a validator for minimum length constraints on strings.

    value

    The minimum allowed length.

    countCodePoints

    A boolean parameter that determines whether the validation will consider code points or character count. When set to true, the validator will consider characters that are represented using two code units (a surrogate pair) in UTF-16 encoding allowing for a more accurate length validation for strings containing such characters (like emojis). Defaults to false, where length is validated based on the number of Char values in the string.

  27. def minLength[T <: String](value: Int): Primitive[T]

    Create a validator for minimum length constraints on strings.

    Create a validator for minimum length constraints on strings.

    value

    The minimum allowed length.

  28. def minSize[T, C[_] <: Iterable[_]](value: Int): Primitive[C[T]]
  29. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  30. def negative[T](implicit arg0: Numeric[T]): Primitive[T]
  31. def nonEmpty[T, C[_] <: Iterable[_]]: Primitive[C[T]]
  32. def nonEmptyString[T <: String]: Primitive[T]
  33. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  34. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  35. def pass[T]: Validator[T]

    A validator instance that always pass.

  36. def pattern[T <: String](value: String): Primitive[T]
  37. def positive[T](implicit arg0: Numeric[T]): Primitive[T]
  38. def positiveOrZero[T](implicit arg0: Numeric[T]): Primitive[T]
  39. def reject[T]: Validator[T]

    A validator instance that always reject.

  40. def show[T](v: Validator[T]): Option[String]
  41. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  42. def toString(): String
    Definition Classes
    AnyRef → Any
  43. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  45. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. object Any extends Serializable
  47. object MaxLength extends Serializable
  48. object MinLength extends Serializable

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from ValidatorMacros

Inherited from AnyRef

Inherited from scala.Any

Ungrouped