Trait/Object

japgolly.microlibs.utils

SafeBool

Related Docs: object SafeBool | package utils

Permalink

trait SafeBool[B <: SafeBool[B]] extends Product with Serializable

Boolean isomorphism.

Mix into the base type and override this.companion there.

Examples:

sealed trait Enabled extends SafeBool[Enabled] {
  override final def companion = Enabled
}

case object Enabled extends Enabled with SafeBool.Object[Enabled] {
  override def positive = Enabled
  override def negative = Disabled
}

case object Disabled extends Enabled
sealed abstract class Permission extends SafeBool.WithBoolOps[Permission] {
  override final def companion = Permission
}

case object Allow extends Permission
case object Deny extends Permission

object Permission extends SafeBool.Object[Permission] {
  override def positive = Allow
  override def negative = Deny
}
Self Type
B
Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SafeBool
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def canEqual(that: Any): Boolean

    Permalink
    Definition Classes
    Equals
  2. abstract def companion: Object[B]

    Permalink
  3. abstract def productArity: Int

    Permalink
    Definition Classes
    Product
  4. abstract def productElement(n: Int): Any

    Permalink
    Definition Classes
    Product

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def fnToThisWhen[A](f: (A) ⇒ Boolean): (A) ⇒ B

    Permalink
  10. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  11. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  12. final def is(b: B): Boolean

    Permalink
    Annotations
    @inline()
  13. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. def productIterator: Iterator[Any]

    Permalink
    Definition Classes
    Product
  18. def productPrefix: String

    Permalink
    Definition Classes
    Product
  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  20. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  21. final def unary_!: B

    Permalink
  22. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def when(cond: Boolean): B

    Permalink
    Annotations
    @inline()
  26. final def whenAllAre(bs: B*): B

    Permalink
  27. final def whenAnyAre(bs: B*): B

    Permalink

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped