trait Decoder[A] extends Serializable
- Self Type
- Decoder[A]
- Alphabetic
- By Inheritance
- Decoder
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def accumulating: AccumulatingDecoder[A]
-
final
def
and[B](fb: Decoder[B]): Decoder[(A, B)]
Run two decoders and return their results as a pair.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
decodeJson(j: Json): Result[A]
Decode the given Json value.
-
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
-
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
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.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.
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
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.
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
kleisli: Kleisli[Result, HCursor, A]
Convert to a Kleisli arrow.
-
final
def
map[B](f: (A) ⇒ B): Decoder[B]
Map a function over this Decoder.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
final
def
or[AA >: A](d: ⇒ Decoder[AA]): Decoder[AA]
Choose the first succeeding decoder.
-
final
def
prepare(f: (HCursor) ⇒ ACursor): Decoder[A]
Create a new decoder that performs some operation on the incoming JSON before decoding.
-
final
def
product[B](x: Decoder[B]): (HCursor, HCursor) ⇒ Result[(A, B)]
Run two decoders.
-
final
def
split[B](d: Decoder[B]): (Either[HCursor, HCursor]) ⇒ Result[Either[A, B]]
Run one or another 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.
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. - def tryDecodeAccumulating(c: ACursor): Result[A]
-
final
def
validate(pred: (HCursor) ⇒ Boolean, message: ⇒ String): Decoder[A]
Build a new instance that fails if the condition does not hold.
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
withErrorMessage(message: String): Decoder[A]
Build a new instance with the specified error message.