Trait/Object

io.circe

Decoder

Related Docs: object Decoder | package circe

Permalink

trait Decoder[A] extends Serializable

A type class that provides a way to produce a value of type A from a Json value.

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

Abstract Value Members

  1. abstract def apply(c: HCursor): Result[A]

    Permalink

    Decode the given HCursor.

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 asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def decodeAccumulating(c: HCursor): AccumulatingResult[A]

    Permalink
  7. final def decodeJson(j: Json): Result[A]

    Permalink

    Decode the given Json value.

  8. final def either[B](decodeB: Decoder[B]): Decoder[Either[A, B]]

    Permalink

    Choose the first succeeding decoder, wrapping the result in a disjunction.

  9. final def emap[B](f: (A) ⇒ Either[String, B]): Decoder[B]

    Permalink

    Create a new decoder that performs some operation on the result if this one succeeds.

    Create a new decoder that performs some operation on the result if this one succeeds.

    f

    a function returning either a value or an error message

  10. final def emapTry[B](f: (A) ⇒ Try[B]): Decoder[B]

    Permalink

    Create a new decoder that performs some operation on the result if this one succeeds.

    Create a new decoder that performs some operation on the result if this one succeeds.

    f

    a function returning either a value or an error message

  11. final def ensure(errors: (A) ⇒ List[String]): Decoder[A]

    Permalink

    Build a new instance that fails with one or more errors if the condition does not hold for the result.

    Build a new instance that fails with one or more errors if the condition does not hold for the result.

    If the result of the function applied to the decoded value is the empty list, the new decoder will succeed with that value.

  12. final def ensure(pred: (A) ⇒ Boolean, message: ⇒ String): Decoder[A]

    Permalink

    Build a new instance that fails if the condition does not hold for the result.

    Build a new instance that fails if the condition does not hold for the result.

    Note that in the case of chained calls to this method, only the first failure will be returned.

  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[B](f: (A) ⇒ Decoder[B]): Decoder[B]

    Permalink

    Monadically bind a function over this Decoder.

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

    Permalink
    Definition Classes
    AnyRef → Any
  18. final def handleErrorWith(f: (DecodingFailure) ⇒ Decoder[A]): Decoder[A]

    Permalink

    Create a new instance that handles any of this instance's errors with the given function.

    Create a new instance that handles any of this instance's errors with the given function.

    Note that in the case of accumulating decoding, only the first error will be used in recovery.

  19. def hashCode(): Int

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

    Permalink
    Definition Classes
    Any
  21. final def kleisli: Kleisli[Result, HCursor, A]

    Permalink

    Convert to a Kleisli arrow.

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

    Permalink

    Map a function over this 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 or[AA >: A](d: ⇒ Decoder[AA]): Decoder[AA]

    Permalink

    Choose the first succeeding decoder.

  27. final def prepare(f: (ACursor) ⇒ ACursor): Decoder[A]

    Permalink

    Create a new decoder that performs some operation on the incoming JSON before decoding.

  28. final def product[B](fb: Decoder[B]): Decoder[(A, B)]

    Permalink

    Run two decoders and return their results as a pair.

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  31. def tryDecode(c: ACursor): Result[A]

    Permalink

    Decode the given ACursor.

    Decode the given ACursor.

    Note that if you override the default implementation, you should also be sure to override tryDecodeAccumulating in order for fail-fast and accumulating decoding to be consistent.

  32. def tryDecodeAccumulating(c: ACursor): AccumulatingResult[A]

    Permalink
  33. final def validate(pred: (HCursor) ⇒ Boolean, message: ⇒ String): Decoder[A]

    Permalink

    Build a new instance that fails if the condition does not hold for the input.

    Build a new instance that fails if the condition does not hold for the input.

    Note that this condition is checked before decoding with the current decoder, and if it does not hold, decoding does not continue. This means that if you chain calls to this method, errors will not be accumulated (instead only the error of the last failing validate in the chain will be returned).

  34. final def validate(errors: (HCursor) ⇒ List[String]): Decoder[A]

    Permalink

    Build a new instance that fails if the condition does not hold for the input.

    Build a new instance that fails if the condition does not hold for the input.

    Note that this condition is checked before decoding with the current decoder, and if it does not hold, decoding does not continue. This means that if you chain calls to this method, errors will not be accumulated (instead only the error of the last failing validate in the chain will be returned).

  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 withErrorMessage(message: String): Decoder[A]

    Permalink

    Build a new instance with the specified error message.

Deprecated Value Members

  1. final def accumulating(c: HCursor): AccumulatingResult[A]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.12.0) Use decodeAccumulating

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped