Decoder

io.bullet.borer.Decoder$
See theDecoder companion trait
object Decoder extends LowPrioDecoders

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Decoder.type

Members list

Concise view

Type members

Classlikes

trait DefaultValueAware[T] extends Decoder[T]

A Decoder that might change its encoding strategy if T has a default value.

A Decoder that might change its encoding strategy if T has a default value.

Attributes

Graph
Supertypes
trait Decoder[T]
class Object
trait Matchable
class Any
object ForEither

The default Decoder for Either is not automatically in scope, because there is no clear "standard" way of encoding instances of Either.

The default Decoder for Either is not automatically in scope, because there is no clear "standard" way of encoding instances of Either.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
trait Lazy[T] extends Decoder[T]

A Decoder that lazily wraps another Decoder. Useful, for example, for recursive definitions.

A Decoder that lazily wraps another Decoder. Useful, for example, for recursive definitions.

Attributes

Graph
Supertypes
trait Decoder[T]
class Object
trait Matchable
class Any

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Value members

Concrete methods

def apply[T](implicit decoder: Decoder[T]): Decoder[T]

Creates a Decoder from the given function.

Creates a Decoder from the given function.

Attributes

def forByte(intDecoder: Decoder[Int]): Decoder[Byte]
def forByteArray(jsonBaseEncoding: BaseEncoding): Decoder[Array[Byte]]
def forChar(intDecoder: Decoder[Int]): Decoder[Char]
def forJBigInteger(maxCborByteArraySize: Int, maxJsonNumberStringLength: Int, acceptStrings: Boolean): Decoder[BigInteger]
inline def forProduct[T <: Product](implicit m: ProductOf[T]): Decoder[T]

Creates a Decoder that decodes a product instance from a simple array of values. Used, for example, as the default 'given' decoder for tuples.

Creates a Decoder that decodes a product instance from a simple array of values. Used, for example, as the default 'given' decoder for tuples.

Attributes

def forShort(intDecoder: Decoder[Int]): Decoder[Short]
def targetSpecific[T](cbor: Decoder[T], json: Decoder[T]): Decoder[T]

Creates a "unified" Decoder from two decoders that each target only a single data format.

Creates a "unified" Decoder from two decoders that each target only a single data format.

Attributes

Inherited methods

final def constructForMap[A : Decoder, B : Decoder, M <: Map[A, B]](empty: M): Decoder[M]

Attributes

Inherited from:
LowPrioDecoders

Givens

Givens

given fromCodec[T](using codec: Codec[T]): Decoder[T]

Extensions

Extensions

extension [A](underlying: Decoder[A])
def map[B](f: A => B): Decoder[B]
def mapWithReader[B](f: (Reader, A) => B): Decoder[B]
def unwrap: Decoder[A]
def withDefaultValue(defaultValue: A): Decoder[A]
extension [T](underlying: => Decoder[T])

Wraps a Decoder definition with lazy initialization.

Wraps a Decoder definition with lazy initialization.

Attributes

Implicits

Implicits

implicit val _forJBigDecimal: Decoder[BigDecimal]
implicit val _forJBigInteger: Decoder[BigInteger]
implicit def forArray[T : Decoder]: Decoder[Array[T]]
implicit val forBigDecimal: Decoder[BigDecimal]
implicit val forBigInt: Decoder[BigInt]
implicit val forBoolean: Decoder[Boolean]
implicit def forBoxedBoolean: Decoder[Boolean]
implicit def forBoxedByte: Decoder[Byte]
implicit def forBoxedChar: Decoder[Character]
implicit def forBoxedDouble: Decoder[Double]
implicit def forBoxedFloat: Decoder[Float]
implicit def forBoxedInt: Decoder[Integer]
implicit def forBoxedLong: Decoder[Long]
implicit def forBoxedShort: Decoder[Short]
implicit val forByte: Decoder[Byte]
implicit val forByteArrayDefault: Decoder[Array[Byte]]
implicit val forChar: Decoder[Char]
implicit val forDouble: Decoder[Double]
implicit val forFloat: Decoder[Float]
implicit def forHashMap[A : Decoder, B : Decoder]: Decoder[HashMap[A, B]]
implicit val forInt: Decoder[Int]
implicit def forJBigDecimal(maxCborBigIntMantissaByteArraySize: Int, maxCborAbsExponent: Int, maxJsonNumberStringLength: Int, acceptStrings: Boolean): Decoder[BigDecimal]
implicit def forListMap[A : Decoder, B : Decoder]: Decoder[ListMap[A, B]]
implicit val forLong: Decoder[Long]
implicit val forNull: Decoder[Null]
implicit def forOption[T : Decoder]: DefaultValueAware[Option[T]]
implicit val forShort: Decoder[Short]
implicit val forString: Decoder[String]
implicit def forTreeMap[A : Decoder, B : Decoder]: Decoder[TreeMap[A, B]]
implicit inline def forTuple[T <: Tuple : ProductOf]: Decoder[T]
implicit val forUnit: Decoder[Unit]
implicit def fromFactory[T : Decoder, M[_]](implicit evidence$2: Decoder[T], factory: Factory[T, M[T]]): Decoder[M[T]]

Inherited implicits

final implicit def forMap[A : Decoder, B : Decoder]: Decoder[Map[A, B]]

Attributes

Inherited from:
LowPrioDecoders