Utilities and instances for Decoder.
- Companion:
- class
- Source:
- Decoder.scala
Type members
Classlikes
A decoder for Option[A]
.
A decoder for Option[A]
.
This is modeled as a separate, named, subtype because Option decoders
often have special semantics around the handling of JNull
. By having
this as a named subtype, we premit certain optimizations that would
otherwise not be possible. See circe-generic-extras
for some examples.
- Source:
- Decoder.scala
Helper methods for working with cats.data.StateT values that transform the ACursor.
Helper methods for working with cats.data.StateT values that transform the ACursor.
- Source:
- Decoder.scala
Types
Value members
Concrete methods
Create a decoder that always returns a single value, useful with some flatMap
situations.
Create a decoder that always returns a single value, useful with some flatMap
situations.
- Source:
- Decoder.scala
Construct an instance that always fails with the given DecodingFailure.
Construct an instance that always fails with the given DecodingFailure.
- Source:
- Decoder.scala
Construct an instance that always fails with the given error message.
Construct an instance that always fails with the given error message.
- Source:
- Decoder.scala
Construct an instance from a cats.data.StateT value.
Construct an instance from a cats.data.StateT value.
- Source:
- Decoder.scala
This is for easier interop with code that already returns scala.util.Try. You should
prefer instance
for any new code.
This is for easier interop with code that already returns scala.util.Try. You should
prefer instance
for any new code.
- Source:
- Decoder.scala
Construct an instance from a function that may reattempt on failure.
Construct an instance from a function that may reattempt on failure.
- Source:
- Decoder.scala
Inherited methods
- Inherited from:
- ProductDecoders (hidden)
- Source:
- ProductDecoders.scala
- Inherited from:
- ProductDecoders (hidden)
- Source:
- ProductDecoders.scala
- Inherited from:
- ProductDecoders (hidden)
- Source:
- ProductDecoders.scala
- Inherited from:
- ProductDecoders (hidden)
- Source:
- ProductDecoders.scala
- Inherited from:
- ProductDecoders (hidden)
- Source:
- ProductDecoders.scala
- Inherited from:
- ProductDecoders (hidden)
- Source:
- ProductDecoders.scala
- Inherited from:
- ProductDecoders (hidden)
- Source:
- ProductDecoders.scala
- Inherited from:
- ProductDecoders (hidden)
- Source:
- ProductDecoders.scala
- Inherited from:
- ProductDecoders (hidden)
- Source:
- ProductDecoders.scala
- Inherited from:
- ProductDecoders (hidden)
- Source:
- ProductDecoders.scala
- Inherited from:
- ProductDecoders (hidden)
- Source:
- ProductDecoders.scala
- Inherited from:
- ProductDecoders (hidden)
- Source:
- ProductDecoders.scala
- Inherited from:
- ProductDecoders (hidden)
- Source:
- ProductDecoders.scala
- Inherited from:
- ProductDecoders (hidden)
- Source:
- ProductDecoders.scala
- Inherited from:
- ProductDecoders (hidden)
- Source:
- ProductDecoders.scala
- Inherited from:
- ProductDecoders (hidden)
- Source:
- ProductDecoders.scala
- Inherited from:
- ProductDecoders (hidden)
- Source:
- ProductDecoders.scala
- Inherited from:
- ProductDecoders (hidden)
- Source:
- ProductDecoders.scala
- Inherited from:
- ProductDecoders (hidden)
- Source:
- ProductDecoders.scala
Concrete fields
Implicits
Implicits
Decode a JSON value into a scala.math.BigDecimal.
Decode a JSON value into a scala.math.BigDecimal.
Note that decoding will fail on some very large values that could in principle be represented
as BigDecimal
s (specifically if the scale
is out of the range of scala.Int
when the
unscaledValue
is adjusted to have no trailing zeros). These large values can, however, be
round-tripped through JsonNumber
, so you may wish to use decodeJsonNumber in these cases.
Also note that because scala.scalajs.js.JSON
parses JSON numbers into a floating point
representation, decoding a JSON number into a BigDecimal
on Scala.js may lose precision.
- Source:
- Decoder.scala
Decode a JSON value into a scala.math.BigInt.
Decode a JSON value into a scala.math.BigInt.
Note that decoding will fail if the number has a large number of digits (the limit is currently
1 << 18
, or around a quarter million). Larger numbers can be decoded by mapping over a
scala.math.BigDecimal, but be aware that the conversion to the integral form can be
computationally expensive.
- Source:
- Decoder.scala
Decode a JSON value into a scala.Byte.
Decode a JSON value into a scala.Byte.
See decodeLong for discussion of the approach taken for integral decoding.
- Source:
- Decoder.scala
Decode a JSON value into a scala.Double.
Decode a JSON value into a scala.Double.
Unlike the integral decoders provided here, this decoder will accept values that are too large
to be represented and will return them as PositiveInfinity
or NegativeInfinity
, and it may
lose precision.
- Source:
- Decoder.scala
Decode a JSON value into a scala.Float.
Decode a JSON value into a scala.Float.
See decodeDouble for discussion of the approach taken for floating-point decoding.
- Source:
- Decoder.scala
Decode a JSON value into a scala.Int.
Decode a JSON value into a scala.Int.
See decodeLong for discussion of the approach taken for integral decoding.
- Source:
- Decoder.scala
Decode a JSON value into a java.math.BigDecimal
.
Decode a JSON value into a java.math.BigDecimal
.
- Source:
- Decoder.scala
Decode a JSON value into a java.math.BigInteger
.
Decode a JSON value into a java.math.BigInteger
.
- Source:
- Decoder.scala
Decode a JSON value into a java.lang.Boolean
.
Decode a JSON value into a java.lang.Boolean
.
- Source:
- Decoder.scala
Decode a JSON value into a java.lang.Byte
.
Decode a JSON value into a java.lang.Byte
.
- Source:
- Decoder.scala
Decode a JSON value into a java.lang.Character
.
Decode a JSON value into a java.lang.Character
.
- Source:
- Decoder.scala
Decode a JSON value into a java.lang.Double
.
Decode a JSON value into a java.lang.Double
.
- Source:
- Decoder.scala
Decode a JSON value into a java.lang.Float
.
Decode a JSON value into a java.lang.Float
.
- Source:
- Decoder.scala
Decode a JSON value into a java.lang.Integer
.
Decode a JSON value into a java.lang.Integer
.
- Source:
- Decoder.scala
Decode a JSON value into a java.lang.Long
.
Decode a JSON value into a java.lang.Long
.
- Source:
- Decoder.scala
Decode a JSON value into a java.lang.Short
.
Decode a JSON value into a java.lang.Short
.
- Source:
- Decoder.scala
Decode a JSON value into a scala.Long.
Decode a JSON value into a scala.Long.
Decoding will fail if the value doesn't represent a whole number within the range of the target
type (although it can have a decimal part: e.g. 10.0
will be successfully decoded, but
10.01
will not). If the value is a JSON string, the decoder will attempt to parse it as a
number.
- Source:
- Decoder.scala
- Source:
- Decoder.scala
- Source:
- Decoder.scala
- Source:
- Decoder.scala
- Source:
- Decoder.scala
Decode a JSON value into a scala.Short.
Decode a JSON value into a scala.Short.
See decodeLong for discussion of the approach taken for integral decoding.
- Source:
- Decoder.scala
Inherited implicits
- Inherited from:
- CollectionDecoders (hidden)
- Source:
- CollectionDecoders.scala
- Note:
The resulting instance will not be serializable (in the
java.io.Serializable
sense) unless the provided scala.collection.Factory is serializable.- Inherited from:
- CollectionDecoders (hidden)
- Source:
- CollectionDecoders.scala
Decode a Boolean
whose value is known at compile time.
Decode a Boolean
whose value is known at compile time.
- Inherited from:
- LiteralDecoders (hidden)
- Source:
- LiteralDecoders.scala
Decode a Char
whose value is known at compile time.
Decode a Char
whose value is known at compile time.
- Inherited from:
- LiteralDecoders (hidden)
- Source:
- LiteralDecoders.scala
Decode a Double
whose value is known at compile time.
Decode a Double
whose value is known at compile time.
- Inherited from:
- LiteralDecoders (hidden)
- Source:
- LiteralDecoders.scala
Decode a Float
whose value is known at compile time.
Decode a Float
whose value is known at compile time.
- Inherited from:
- LiteralDecoders (hidden)
- Source:
- LiteralDecoders.scala
Decode a Int
whose value is known at compile time.
Decode a Int
whose value is known at compile time.
- Inherited from:
- LiteralDecoders (hidden)
- Source:
- LiteralDecoders.scala
Decode a Long
whose value is known at compile time.
Decode a Long
whose value is known at compile time.
- Inherited from:
- LiteralDecoders (hidden)
- Source:
- LiteralDecoders.scala
Decode a String
whose value is known at compile time.
Decode a String
whose value is known at compile time.
- Inherited from:
- LiteralDecoders (hidden)
- Source:
- LiteralDecoders.scala
- Note:
The resulting instance will not be serializable (in the
java.io.Serializable
sense) unless the provided scala.collection.Factory is serializable.- Inherited from:
- CollectionDecoders (hidden)
- Source:
- CollectionDecoders.scala
- Note:
The resulting instance will not be serializable (in the
java.io.Serializable
sense) unless the provided scala.collection.Factory is serializable.- Inherited from:
- CollectionDecoders (hidden)
- Source:
- CollectionDecoders.scala
- Inherited from:
- TupleDecoders (hidden)
- Source:
- TupleDecoders.scala
- Inherited from:
- TupleDecoders (hidden)
- Source:
- TupleDecoders.scala
- Inherited from:
- TupleDecoders (hidden)
- Source:
- TupleDecoders.scala
- Inherited from:
- TupleDecoders (hidden)
- Source:
- TupleDecoders.scala
- Inherited from:
- TupleDecoders (hidden)
- Source:
- TupleDecoders.scala
- Inherited from:
- TupleDecoders (hidden)
- Source:
- TupleDecoders.scala
- Inherited from:
- TupleDecoders (hidden)
- Source:
- TupleDecoders.scala
- Inherited from:
- TupleDecoders (hidden)
- Source:
- TupleDecoders.scala
- Inherited from:
- TupleDecoders (hidden)
- Source:
- TupleDecoders.scala
- Inherited from:
- TupleDecoders (hidden)
- Source:
- TupleDecoders.scala
- Inherited from:
- TupleDecoders (hidden)
- Source:
- TupleDecoders.scala
- Inherited from:
- TupleDecoders (hidden)
- Source:
- TupleDecoders.scala
- Inherited from:
- TupleDecoders (hidden)
- Source:
- TupleDecoders.scala
- Inherited from:
- TupleDecoders (hidden)
- Source:
- TupleDecoders.scala
- Inherited from:
- TupleDecoders (hidden)
- Source:
- TupleDecoders.scala
- Inherited from:
- TupleDecoders (hidden)
- Source:
- TupleDecoders.scala