Trait/Object

classy.core

Decoder

Related Docs: object Decoder | package core

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 decode(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 ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. 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.

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

    Permalink

    Construct a new decoder by using the output of this decoder as the input of another

  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. 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.

  8. def clone(): AnyRef

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

    Permalink

    Construct a new decoder by using the result of another decoder as the input to this decoder

  10. 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

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

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

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

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

    Permalink

    Construct a new decoder through a monadic bind

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

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

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

    Permalink
    Definition Classes
    Any
  18. 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

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

    Permalink

    Construct a new decoder by mapping the output of this decoder

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

    Permalink

    Construct a new decoder by mapping the input to this decoder

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

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

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

    Permalink
    Definition Classes
    AnyRef
  24. 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.

  25. 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.

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

    Permalink

    Constructs a new decoder that decodes a sequence of inputs.

    Constructs a new decoder that decodes a sequence of inputs. 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.

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

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

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

    Permalink

    Construct a new decoder that traces the result to stdout

  30. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. 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.

  34. 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

Ungrouped