Class

shapeless.syntax

UnionOps

Related Doc: package syntax

Permalink

final class UnionOps[C <: Coproduct] extends AnyVal with Serializable

Discriminated union operations on Coproducts's with field-like elements.

Linear Supertypes
Serializable, Serializable, AnyVal, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. UnionOps
  2. Serializable
  3. Serializable
  4. AnyVal
  5. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new UnionOps(c: C)

    Permalink

Value Members

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

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

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

    Permalink
    Definition Classes
    Any
  4. def apply(k: Witness)(implicit selector: Selector[C, T]): Out

    Permalink

    Returns the value associated with the singleton typed key k.

    Returns the value associated with the singleton typed key k. Only available if this union has a field with with keyType equal to the singleton type k.T.

    Note that this can creates a bogus ambiguity with CoproductOps#apply as described in https://issues.scala-lang.org/browse/SI-5142. If this method is accessible the conflict can be worked around by using CoproductOps#at instead of CoproductOps#apply.

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. val c: C

    Permalink
  7. def fields(implicit fields: Fields[C]): Out

    Permalink

    Returns a Coproduct made of the key-value pairs of this union.

  8. def get(k: Witness)(implicit selector: Selector[C, T]): Out

    Permalink

    Returns the value associated with the singleton typed key k.

    Returns the value associated with the singleton typed key k. Only available if this union has a field with with keyType equal to the singleton type k.T.

  9. def getClass(): Class[_ <: AnyVal]

    Permalink
    Definition Classes
    AnyVal → Any
  10. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  11. def keys(implicit keys: Keys[C]): Out

    Permalink

    Returns the keys of this union as an HList of singleton typed values.

  12. def mapValues(f: Poly)(implicit mapValues: MapValues[f.type, C]): Out

    Permalink

    Maps a higher rank function across the values of this union.

  13. def toMap[K, V](implicit toMap: Aux[C, K, V]): Map[K, V]

    Permalink

    Returns a Map whose keys and values are typed as the Lub of the keys and values of this union.

  14. def toString(): String

    Permalink
    Definition Classes
    Any
  15. def union: DynamicUnionOps[C]

    Permalink

    Returns a wrapped version of this union that provides selectDynamic access to fields.

  16. def values(implicit values: Values[C]): Out

    Permalink

    Returns a Coproduct of the values of this union.

Inherited from Serializable

Inherited from Serializable

Inherited from AnyVal

Inherited from Any

Ungrouped