Trait/Object

classy

Decoder

Related Docs: object Decoder | package classy

Permalink

trait Decoder[A, B] extends Serializable

A type class capturing the ability to decode data of type A to B.

To construct a new decoder, consider using Decoder.instance.

Linear Supertypes
Serializable, Serializable, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Decoder
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def apply(a: A): Either[DecodeError, B]

    Permalink

    Decode a value of type A as type B

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 <<<[Z](previous: Decoder[Z, A]): Decoder[Z, B]

    Permalink

    Compose this decoder with another by using the output of the other decoder as the input to this decoder

    Compose this decoder with another by using the output of the other decoder as the input to this decoder

    See also

    compose

  4. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  5. final def >>>[C](next: Decoder[B, C]): Decoder[A, C]

    Permalink

    Compose this decoder with another by using the output of this decoder as the input to the other

    Compose this decoder with another by using the output of this decoder as the input to the other

    See also

    andThen

  6. final def and[C](that: Decoder[A, C]): Decoder[A, (B, C)]

    Permalink

    Construct a new decoder by joining this decoder with another, tupling the results.

    Construct a new decoder by joining this decoder with another, tupling the results. Errors accumulate.

  7. final def andThen[C](next: Decoder[B, C]): Decoder[A, C]

    Permalink

    Compose this decoder with another by using the output of this decoder as the input to the other

    Compose this decoder with another by using the output of this decoder as the input to the other

    See also

    >>>

  8. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  9. final def atPath(path: String)(implicit read: Read[A, A]): Decoder[A, B]

    Permalink

    Construct a new decoder that first reads a path.

    Construct a new decoder that first reads a path. The value read is then passed to this decoder. Errors are adjusted to reflect that they occurred at a nested path.

  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. final def compose[Z](previous: Decoder[Z, A]): Decoder[Z, B]

    Permalink

    Compose this decoder with another by using the output of the other decoder as the input to this decoder

    Compose this decoder with another by using the output of the other decoder as the input to this decoder

    See also

    <<<

  12. final def decode(a: A): Either[DecodeError, B]

    Permalink

    Decode a value of type A as type B.

    Decode a value of type A as type B.

    This is an alias for apply.

  13. final def deepOptional: Decoder[A, Option[B]]

    Permalink

    Constructs a new decoder that optionally decodes a value.

    Constructs a new decoder that optionally decodes a value. Deep errors other than a missing value still cause the resulting decoder to fail

    See also

    DecodeError.AtPath.deepError

  14. final def emap[C](f: (B) ⇒ Either[DecodeError, C]): Decoder[A, C]

    Permalink

    Construct a new decoder by mapping the output of this decoder to either a DecodeError or a new result type

  15. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. final def flatMap[C](f: (B) ⇒ Decoder[A, C]): Decoder[A, C]

    Permalink

    Construct a new decoder through a monadic bind

  19. final def getClass(): Class[_]

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

    Permalink
    Definition Classes
    AnyRef → Any
  21. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  22. final def join[C](that: Decoder[A, C]): Decoder[A, (B, C)]

    Permalink

    [use case] Construct a new decoder by joining this decoder with another, tupling the results.

    [use case]

    Construct a new decoder by joining this decoder with another, tupling the results. Errors accumulate.

    This behaves similar to and except that instead of always returning a nested tuple it attempts to return a flattened tuple.

    Full Signature

    final def join[C](that: Decoder[A, C])(implicit j: Join[B, C]): Decoder[A, Out]

  23. final def leftMap(f: (DecodeError) ⇒ DecodeError): Decoder[A, B]

    Permalink

    Construct a new decoder by mapping the error output of this decoder to a new error

  24. def lub[B1, B2, BB](implicit ev0: <:<[B, Either[B1, B2]], ev1: <:<[B1, BB], ev2: <:<[B2, BB]): Decoder[A, BB]

    Permalink

    Convert a coproduct decoder to a decoder to the least upper bound of the disjunct types

  25. final def map[C](f: (B) ⇒ C): Decoder[A, C]

    Permalink

    Construct a new decoder by mapping the output of this decoder

  26. final def mapInput[Z](f: (Z) ⇒ A): Decoder[Z, B]

    Permalink

    Construct a new decoder by mapping the input to this decoder

  27. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  30. final def optional: Decoder[A, Option[B]]

    Permalink

    Constructs a new decoder that optionally decodes a value.

    Constructs a new decoder that optionally decodes a value. Errors other than a missing value still cause the resulting decoder to fail.

  31. final def or[BB >: B](that: Decoder[A, BB]): Decoder[A, BB]

    Permalink

    Construct a new decoder using this decoder first.

    Construct a new decoder using this decoder first. If it fails, use the other. Errors accumulate.

  32. final def sequence: Decoder[List[A], List[B]]

    Permalink

    [use case] Constructs a new decoder that decodes a sequence of inputs into a sequence of outputs.

    [use case]

    Constructs a new decoder that decodes a sequence of inputs into a sequence of outputs.

    The result is sequenced so that any errors cause the overall decoder to fail. Errors accumulate and are marked with their index if they fail.

    Full Signature

    final def sequence[F[_]](implicit Ft: Traversable[F], Fi: Indexed[F]): Decoder[F[A], F[B]]

  33. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Permalink
    Definition Classes
    AnyRef → Any
  35. final def trace(prefix: String = "> "): Decoder[A, B]

    Permalink

    Construct a new decoder that traces the result to stdout

  36. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def withDeepDefault(default: B): Decoder[A, B]

    Permalink

    Constructs a new decoder that falls back to a default value if a deep missing value error occurs

    Constructs a new decoder that falls back to a default value if a deep missing value error occurs

    See also

    DecodeError.AtPath.deepError

  40. final def withDefault(default: B): Decoder[A, B]

    Permalink

    Constructs a new decoder that falls back to a default value if a missing value error occurs

  41. final def withFallback(fallback: B): Decoder[A, B]

    Permalink

    Constructs a new decoder that falls back to a value if any error occurs

    Constructs a new decoder that falls back to a value if any error occurs

    To provide default values for a decoder, consider using withDefault.

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Abstract Value Members

Concrete Value Members

Ungrouped