Utilities and instances for Decoder.
Attributes
- Companion
- trait
- Source
- Decoder.scala
- Graph
-
- Supertypes
- Self type
-
Decoder.type
Members list
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.
Attributes
- Source
- Decoder.scala
- Supertypes
Value members
Concrete methods
Return an instance for a given type.
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.
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Construct an instance that always fails with the given DecodingFailure.
Construct an instance that always fails with the given DecodingFailure.
Attributes
- 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.
Attributes
- Source
- Decoder.scala
Construct an instance from a cats.data.StateT value.
Construct an instance from a function.
This is for easier interop with code that already returns scala.util.Try.
This is for easier interop with code that already returns scala.util.Try. You should prefer instance
for any new code.
Attributes
- Source
- Decoder.scala
Create a Decoder
which assumes one already exists
Create a Decoder
which assumes one already exists
Certain recursive data structures (particularly when generic) greatly benefit from being able to be written this way. See cats.Defer
Note: while a Decoder
written using Decoder.recursive
can prevent unneeded creation of Decoder
instances when recursing, the resulting Decoder
cannot be guaranteed to be stack-safe.
Attributes
- 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.
Attributes
- Source
- Decoder.scala
Inherited methods
object WeekDay extends Enumeration { ... }
implicit val weekDayDecoder = Decoder.decodeEnumeration(WeekDay)
Attributes
- Inherited from:
- EnumerationDecoders (hidden)
- Source
- EnumerationDecoders.scala
Attributes
- Inherited from:
- DecoderDerivation (hidden)
- Source
- Derivation.scala
Attributes
- Inherited from:
- DecoderDerivation (hidden)
- Source
- Derivation.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Attributes
- Inherited from:
- ProductDecoders (hidden)
- Source
- ProductDecoders.scala
Implicits
Implicits
Attributes
- Source
- Decoder.scala
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.
Attributes
- 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.
Attributes
- Source
- Decoder.scala
Attributes
- 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.
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- 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.
Attributes
- Source
- Decoder.scala
Attributes
- 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.
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- 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.
Attributes
- Source
- Decoder.scala
Decode a JSON value into a java.math.BigDecimal
.
Decode a JSON value into a java.math.BigInteger
.
Decode a JSON value into a java.lang.Boolean
.
Decode a JSON value into a java.lang.Byte
.
Decode a JSON value into a java.lang.Character
.
Decode a JSON value into a java.lang.Double
.
Decode a JSON value into a java.lang.Float
.
Decode a JSON value into a java.lang.Integer
.
Decode a JSON value into a java.lang.Long
.
Decode a JSON value into a java.lang.Short
.
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- 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.
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- 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.
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Attributes
- Source
- Decoder.scala
Inherited implicits
Attributes
- Inherited from:
- CollectionDecoders (hidden)
- Source
- CollectionDecoders.scala
Attributes
- Inherited from:
- CollectionDecoders (hidden)
- Source
- CollectionDecoders.scala
Attributes
- 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.
Attributes
- 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.
Attributes
- 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.
Attributes
- 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.
Attributes
- 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.
Attributes
- 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.
Attributes
- 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.
Attributes
- Inherited from:
- LiteralDecoders (hidden)
- Source
- LiteralDecoders.scala
Attributes
- 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
Attributes
- 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
Attributes
- Inherited from:
- TupleDecoders (hidden)
- Source
- TupleDecoders.scala
Attributes
- Inherited from:
- TupleDecoders (hidden)
- Source
- TupleDecoders.scala
Attributes
- Inherited from:
- TupleDecoders (hidden)
- Source
- TupleDecoders.scala
Attributes
- Inherited from:
- TupleDecoders (hidden)
- Source
- TupleDecoders.scala
Attributes
- Inherited from:
- TupleDecoders (hidden)
- Source
- TupleDecoders.scala
Attributes
- Inherited from:
- TupleDecoders (hidden)
- Source
- TupleDecoders.scala
Attributes
- Inherited from:
- TupleDecoders (hidden)
- Source
- TupleDecoders.scala
Attributes
- Inherited from:
- TupleDecoders (hidden)
- Source
- TupleDecoders.scala
Attributes
- Inherited from:
- TupleDecoders (hidden)
- Source
- TupleDecoders.scala
Attributes
- Inherited from:
- TupleDecoders (hidden)
- Source
- TupleDecoders.scala
Attributes
- Inherited from:
- TupleDecoders (hidden)
- Source
- TupleDecoders.scala
Attributes
- Inherited from:
- TupleDecoders (hidden)
- Source
- TupleDecoders.scala
Attributes
- Inherited from:
- TupleDecoders (hidden)
- Source
- TupleDecoders.scala
Attributes
- Inherited from:
- TupleDecoders (hidden)
- Source
- TupleDecoders.scala
Attributes
- Inherited from:
- TupleDecoders (hidden)
- Source
- TupleDecoders.scala
Attributes
- Inherited from:
- TupleDecoders (hidden)
- Source
- TupleDecoders.scala
Attributes
- Inherited from:
- TupleDecoders (hidden)
- Source
- TupleDecoders.scala
Attributes
- Inherited from:
- TupleDecoders (hidden)
- Source
- TupleDecoders.scala
Attributes
- Inherited from:
- TupleDecoders (hidden)
- Source
- TupleDecoders.scala
Attributes
- Inherited from:
- TupleDecoders (hidden)
- Source
- TupleDecoders.scala
Attributes
- Inherited from:
- TupleDecoders (hidden)
- Source
- TupleDecoders.scala
Attributes
- Inherited from:
- TupleDecoders (hidden)
- Source
- TupleDecoders.scala
Attributes
- Inherited from:
- LowPriorityCollectionDecoders (hidden)
- Source
- CollectionDecoders.scala
Attributes
- Inherited from:
- LowPriorityDecoders (hidden)
- Source
- Decoder.scala