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 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 ==(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 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.

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

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

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

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

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

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

    Permalink

    Construct a new decoder through a monadic bind

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

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

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

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

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

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

    Permalink

    Construct a new decoder by mapping the output of this decoder

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

    Permalink

    Construct a new decoder by mapping the input to this decoder

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

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

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

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

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

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

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

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

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

    Permalink

    Construct a new decoder that traces the result to stdout

  33. final def wait(): Unit

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

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

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

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

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