Packages

  • package root
    Definition Classes
    root
  • package zio
    Definition Classes
    root
  • package prelude
    Definition Classes
    zio
  • object Assertion

    An Assertion[A] is essentially a composable predicate from A => Boolean.

    An Assertion[A] is essentially a composable predicate from A => Boolean. They can be composed with standard Boolean operators of &&, || and !. This is primarily intended to be used with Newtype and Subtype, enhancing them with compile-time time validation.

    For example, if you'd like to validate that a particular Int is precisely 4 digits long, you can create the following refined Newtype. (Note that the syntax is slightly difference between Scala 2 and Scala 3).

    type Pin = Pin.Type
    object Pin extends Newtype[Int] {
      // Scala 2 Syntax
      def assertion =
        assert(Assertion.between(1000, 9999))
    
      // Scala 3 Syntax
      override inline def assertion =
        Assertion.between(1000, 9999)
    }
    
    // PowerOfTwo(1000) compiles
    // PowerOfTwo(5412) compiles
    // PowerOfTwo(34567) fails with "34567 did not satisfy between(1000, 9999)"
    // PowerOfTwo(234) fails with "123 did not satisfy between(1000, 9999)"
    Definition Classes
    prelude
  • object Regex
    Definition Classes
    Assertion
  • Alphanumeric
  • AndThen
  • AnyChar
  • Anything
  • CharacterSet
  • Digit
  • End
  • Literal
  • OrElse
  • Range
  • Repeat
  • Start
  • Whitespace

final case class Range(start: Char, end: Char, reversed: Boolean) extends Regex with Product with Serializable

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Range
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Regex
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Range(start: Char, end: Char, reversed: Boolean)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def *: Regex
    Definition Classes
    Regex
  4. def +: Regex
    Definition Classes
    Regex
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. def ?: Regex
    Definition Classes
    Regex
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def between(min: Int, max: Int): Regex
    Definition Classes
    Regex
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  10. def compile: String
    Definition Classes
    RangeRegex
  11. val end: Char
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  15. def max(n: Int): Regex
    Definition Classes
    Regex
  16. def min(n: Int): Regex
    Definition Classes
    Regex
  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  20. val reversed: Boolean
  21. val start: Char
  22. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  23. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  25. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. def |(that: Regex): Regex
    Definition Classes
    Regex
  27. def ~(that: Regex): Regex
    Definition Classes
    Regex

Deprecated Value Members

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

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Regex

Inherited from AnyRef

Inherited from Any

Ungrouped