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 Whitespace(reversed: Boolean) extends Regex with Product with Serializable

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Whitespace
  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 Whitespace(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. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def between(min: Int, max: Int): Regex
    Definition Classes
    Regex
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  9. def compile: String
    Definition Classes
    WhitespaceRegex
  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. def max(n: Int): Regex
    Definition Classes
    Regex
  15. def min(n: Int): Regex
    Definition Classes
    Regex
  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. val reversed: Boolean
  20. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  21. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  24. def |(that: Regex): Regex
    Definition Classes
    Regex
  25. def ~(that: Regex): Regex
    Definition Classes
    Regex

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Regex

Inherited from AnyRef

Inherited from Any

Ungrouped