Class

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

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

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

    Definition Classes
    Decoder
  6. 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
  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. 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
  9. def clone(): AnyRef

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

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

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

  13. 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
  14. final def eq(arg0: AnyRef): Boolean

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

    Construct a new decoder through a monadic bind

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

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

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

  20. 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
  21. 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
  22. 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
  23. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  26. 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
  27. 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
  28. val run: (A) ⇒ Either[DecodeError, B]

    Permalink

    the backing function

  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.

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

    Permalink
    Definition Classes
    AnyRef
  31. 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
  32. final def wait(): Unit

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

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

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

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

Ungrouped