Class

classy.Decoder

Instance

Related Doc: package Decoder

Permalink

final case class Instance[A, B](run: (A) ⇒ Either[DecodeError, B]) extends Decoder[A, B] with Product with Serializable

The default implementation of Decoder backed by a function A => Either[DecodeError, B]

run

the backing function

Linear Supertypes
Product, Equals, Decoder[A, B], Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Instance
  2. Product
  3. Equals
  4. Decoder
  5. Serializable
  6. Serializable
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Instance(run: (A) ⇒ Either[DecodeError, B])

    Permalink

    run

    the backing function

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

    Definition Classes
    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

    Definition Classes
    Decoder
    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.

    Definition Classes
    Decoder
  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

    Definition Classes
    Decoder
    See also

    >>>

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

    Permalink

    Decode a value of type A as type B

    Decode a value of type A as type B

    Definition Classes
    InstanceDecoder
  9. final def asInstanceOf[T0]: T0

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

    Definition Classes
    Decoder
  11. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. 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

    Definition Classes
    Decoder
    See also

    <<<

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

    Definition Classes
    Decoder
  14. 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

    Definition Classes
    Decoder
    See also

    DecodeError.AtPath.deepError

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

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

    Definition Classes
    Decoder
  16. final def eq(arg0: AnyRef): Boolean

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

    Construct a new decoder through a monadic bind

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

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

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

    Definition Classes
    Decoder
    Full Signature

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

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

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

    Definition Classes
    Decoder
  23. 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

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

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

    Permalink

    Construct a new decoder by mapping the output of this decoder

    Construct a new decoder by mapping the output of this decoder

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

    Permalink

    Construct a new decoder by mapping the input to this decoder

    Construct a new decoder by mapping the input to this decoder

    Definition Classes
    Decoder
  26. final def ne(arg0: AnyRef): Boolean

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

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

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

    Definition Classes
    Decoder
  30. 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.

    Definition Classes
    Decoder
  31. val run: (A) ⇒ Either[DecodeError, B]

    Permalink

    the backing function

  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.

    Definition Classes
    Decoder
    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. final def trace(prefix: String = "> "): Decoder[A, B]

    Permalink

    Construct a new decoder that traces the result to stdout

    Construct a new decoder that traces the result to stdout

    Definition Classes
    Decoder
  35. final def wait(): Unit

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

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

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

    Definition Classes
    Decoder
    See also

    DecodeError.AtPath.deepError

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

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

    Definition Classes
    Decoder
  40. 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.

    Definition Classes
    Decoder

Inherited from Product

Inherited from Equals

Inherited from Decoder[A, B]

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Abstract Value Members

Concrete Value Members

Ungrouped