trait AsObject[A] extends AsRoot[A] with Encoder.AsObject[A]
- Alphabetic
- By Inheritance
- AsObject
- AsObject
- AsRoot
- AsRoot
- Codec
- Encoder
- Decoder
- Serializable
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- def ->[B](y: B): (AsObject[A], B)
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def apply(a: A): Json
Convert a value to JSON.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- 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
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- 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 anA
. - final def contramapObject[B](f: (B) => A): Encoder.AsObject[B]
Create a new AsObject by applying a function to a value of type
B
before encoding as anA
. - def decodeAccumulating(c: HCursor): AccumulatingResult[A]
- Definition Classes
- Decoder
- final def decodeJson(j: Json): Result[A]
Decode the given Json value.
- 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
- 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
- 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
- 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
- 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
- def ensuring(cond: (AsObject[A]) => Boolean, msg: => Any): AsObject[A]
- def ensuring(cond: (AsObject[A]) => Boolean): AsObject[A]
- def ensuring(cond: Boolean, msg: => Any): AsObject[A]
- def ensuring(cond: Boolean): AsObject[A]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def flatMap[B](f: (A) => Decoder[B]): Decoder[B]
Monadically bind a function over this Decoder.
- def formatted(fmtstr: String): String
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- 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
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def iemap[B](f: (A) => Either[String, B])(g: (B) => A): Codec[B]
Variant of
imap
which allows the Decoder to fail. - final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def kleisli: Kleisli[Result, HCursor, A]
Convert to a Kleisli arrow.
Convert to a Kleisli arrow.
- Definition Classes
- Decoder
- final def map[B](f: (A) => B): Decoder[B]
Map a function over this Decoder.
- final def mapJson(f: (Json) => Json): Encoder[A]
Create a new Encoder by applying a function to the output of this one.
- final def mapJsonObject(f: (JsonObject) => JsonObject): Encoder.AsObject[A]
Create a new AsObject by applying a function to the output of this one.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def or[AA >: A](d: => Decoder[AA]): Decoder[AA]
Choose the first succeeding decoder.
Choose the first succeeding decoder.
- Definition Classes
- Decoder
- 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
- 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
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def tryDecode(c: ACursor): Result[A]
Decode the given ACursor.
- def tryDecodeAccumulating(c: ACursor): AccumulatingResult[A]
- Definition Classes
- Decoder
- 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
- 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
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- 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
- def →[B](y: B): (AsObject[A], B)
- Implicit
- This member is added by an implicit conversion from AsObject[A] toArrowAssoc[AsObject[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.