Packages

  • package root
    Definition Classes
    root
  • package io
    Definition Classes
    root
  • package circe

    This is the API documentation for Circe, a JSON library for Scala and Scala.js.

    Overview

    This is the API documentation for Circe, a JSON library for Scala and Scala.js.

    The library is divided into a number of modules that either provide core functionality, support additional features via third-party dependencies, or facilitate integration with other libraries or frameworks.

    • numbers: core facilities for representing and parsing JSON numbers.
    • core: our JSON abstract syntax tree, our zipper-like cursor types, and our encoding and decoding type classes (and instances).
    • parser: JSON parsing support for both the Java Virtual Machine (using Jawn) and Scala.js (using the native JavaScript JSON parser).
    • testing: ScalaCheck Arbitrary instances for circe's JSON AST and other types, as well as other useful testing tools.
    • literal: JSON string interpolation and encoder and decoder instances for literal types.
    • generic: Shapeless-powered generic derivation for case classes and sealed trait hierarchies.
    • generic-extras: additional experimental generic derivation functionality (including some configurability).
    • pointer: A JSON Pointer implementation
    • pointer-literal: JSON Pointer string interpolation
    • shapes: encoders and decoders for Shapeless hlists, coproducts, records, and sized collections.
    • scodec: encoders and decoders for Scodec's BitVector and ByteVector.
    • refined: encoders and decoders for refined types.
    • spray: Spray marshaller conversions for Circe's type classes.

    Please refer to the documentation for a more detailed introduction to the library.

    Definition Classes
    io
  • package generic
    Definition Classes
    circe
  • package codec
    Definition Classes
    generic
  • DerivedAsObjectCodec
  • ReprAsObjectCodec

abstract class ReprAsObjectCodec[A] extends AsObject[A]

A codec for a generic representation of a case class or ADT.

Note that users typically will not work with instances of this class.

Source
ReprAsObjectCodec.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ReprAsObjectCodec
  2. AsObject
  3. AsObject
  4. AsRoot
  5. AsRoot
  6. Codec
  7. Encoder
  8. Decoder
  9. Serializable
  10. AnyRef
  11. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new ReprAsObjectCodec()

Abstract Value Members

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

    Decode the given HCursor.

    Decode the given HCursor.

    Definition Classes
    Decoder
  2. abstract def encodeObject(a: A): JsonObject

    Convert a value to a JSON object.

    Convert a value to a JSON object.

    Definition Classes
    AsObject

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from ReprAsObjectCodec[A] toany2stringadd[ReprAsObjectCodec[A]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (ReprAsObjectCodec[A], B)
    Implicit
    This member is added by an implicit conversion from ReprAsObjectCodec[A] toArrowAssoc[ReprAsObjectCodec[A]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def apply(a: A): Json

    Convert a value to JSON.

    Convert a value to JSON.

    Definition Classes
    AsObjectEncoder
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. final def at(field: String): Decoder[A]

    Create a new decoder that attempts to navigate to the specified field before decoding.

    Create a new decoder that attempts to navigate to the specified field before decoding.

    Definition Classes
    Decoder
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  10. final def contramap[B](f: (B) => A): Encoder[B]

    Create a new Encoder by applying a function to a value of type B before encoding as an A.

    Create a new Encoder by applying a function to a value of type B before encoding as an A.

    Definition Classes
    Encoder
  11. final def contramapObject[B](f: (B) => A): AsObject[B]

    Create a new AsObject by applying a function to a value of type B before encoding as an A.

    Create a new AsObject by applying a function to a value of type B before encoding as an A.

    Definition Classes
    AsObject
  12. def decodeAccumulating(c: HCursor): AccumulatingResult[A]
    Definition Classes
    Decoder
  13. final def decodeJson(j: Json): Result[A]

    Decode the given Json value.

    Decode the given Json value.

    Definition Classes
    Decoder
  14. final def either[B](decodeB: Decoder[B]): Decoder[Either[A, B]]

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

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

    Definition Classes
    Decoder
  15. final def emap[B](f: (A) => Either[String, B]): Decoder[B]

    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

    Definition Classes
    Decoder
  16. final def emapTry[B](f: (A) => Try[B]): Decoder[B]

    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

    Definition Classes
    Decoder
  17. final def ensure(errors: (A) => List[String]): Decoder[A]

    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.

    Definition Classes
    Decoder
  18. final def ensure(pred: (A) => Boolean, message: => String): Decoder[A]

    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.

    Definition Classes
    Decoder
  19. def ensuring(cond: (ReprAsObjectCodec[A]) => Boolean, msg: => Any): ReprAsObjectCodec[A]
    Implicit
    This member is added by an implicit conversion from ReprAsObjectCodec[A] toEnsuring[ReprAsObjectCodec[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  20. def ensuring(cond: (ReprAsObjectCodec[A]) => Boolean): ReprAsObjectCodec[A]
    Implicit
    This member is added by an implicit conversion from ReprAsObjectCodec[A] toEnsuring[ReprAsObjectCodec[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  21. def ensuring(cond: Boolean, msg: => Any): ReprAsObjectCodec[A]
    Implicit
    This member is added by an implicit conversion from ReprAsObjectCodec[A] toEnsuring[ReprAsObjectCodec[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  22. def ensuring(cond: Boolean): ReprAsObjectCodec[A]
    Implicit
    This member is added by an implicit conversion from ReprAsObjectCodec[A] toEnsuring[ReprAsObjectCodec[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  23. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  25. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  26. final def flatMap[B](f: (A) => Decoder[B]): Decoder[B]

    Monadically bind a function over this Decoder.

    Monadically bind a function over this Decoder.

    Definition Classes
    Decoder
  27. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from ReprAsObjectCodec[A] toStringFormat[ReprAsObjectCodec[A]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  28. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  29. final def handleErrorWith(f: (DecodingFailure) => Decoder[A]): Decoder[A]

    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.

    Definition Classes
    Decoder
  30. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  31. def iemap[B](f: (A) => Either[String, B])(g: (B) => A): Codec[B]

    Variant of imap which allows the Decoder to fail.

    Variant of imap which allows the Decoder to fail.

    B

    the type of the new Codec

    f

    decode value

    g

    encode value

    returns

    a codec for B

    Definition Classes
    Codec
  32. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  33. final def kleisli: Kleisli[Result, HCursor, A]

    Convert to a Kleisli arrow.

    Convert to a Kleisli arrow.

    Definition Classes
    Decoder
  34. final def map[B](f: (A) => B): Decoder[B]

    Map a function over this Decoder.

    Map a function over this Decoder.

    Definition Classes
    Decoder
  35. final def mapJson(f: (Json) => Json): Encoder[A]

    Create a new Encoder by applying a function to the output of this one.

    Create a new Encoder by applying a function to the output of this one.

    Definition Classes
    Encoder
  36. final def mapJsonObject(f: (JsonObject) => JsonObject): AsObject[A]

    Create a new AsObject by applying a function to the output of this one.

    Create a new AsObject by applying a function to the output of this one.

    Definition Classes
    AsObject
  37. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  38. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  39. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  40. final def or[AA >: A](d: => Decoder[AA]): Decoder[AA]

    Choose the first succeeding decoder.

    Choose the first succeeding decoder.

    Definition Classes
    Decoder
  41. final def prepare(f: (ACursor) => ACursor): Decoder[A]

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

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

    Definition Classes
    Decoder
  42. final def product[B](fb: Decoder[B]): Decoder[(A, B)]

    Run two decoders and return their results as a pair.

    Run two decoders and return their results as a pair.

    Definition Classes
    Decoder
  43. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  44. def toString(): String
    Definition Classes
    AnyRef → Any
  45. def tryDecode(c: ACursor): Result[A]

    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.

    Definition Classes
    Decoder
  46. def tryDecodeAccumulating(c: ACursor): AccumulatingResult[A]
    Definition Classes
    Decoder
  47. final def validate(pred: (HCursor) => Boolean, message: => String): Decoder[A]

    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.

    Definition Classes
    Decoder
  48. final def validate(errors: (HCursor) => List[String]): Decoder[A]

    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.

    Definition Classes
    Decoder
  49. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  50. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  51. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  52. final def withErrorMessage(message: String): Decoder[A]

    Build a new instance with the specified error message.

    Build a new instance with the specified error message.

    Definition Classes
    Decoder

Deprecated Value Members

  1. def [B](y: B): (ReprAsObjectCodec[A], B)
    Implicit
    This member is added by an implicit conversion from ReprAsObjectCodec[A] toArrowAssoc[ReprAsObjectCodec[A]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use -> instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.

Inherited from AsObject[A]

Inherited from AsObject[A]

Inherited from AsRoot[A]

Inherited from AsRoot[A]

Inherited from Codec[A]

Inherited from Encoder[A]

Inherited from Decoder[A]

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd fromReprAsObjectCodec[A] to any2stringadd[ReprAsObjectCodec[A]]

Inherited by implicit conversion StringFormat fromReprAsObjectCodec[A] to StringFormat[ReprAsObjectCodec[A]]

Inherited by implicit conversion Ensuring fromReprAsObjectCodec[A] to Ensuring[ReprAsObjectCodec[A]]

Inherited by implicit conversion ArrowAssoc fromReprAsObjectCodec[A] to ArrowAssoc[ReprAsObjectCodec[A]]

Ungrouped