AsObject

trait AsObject[A] extends AsRoot[A]

A type class that provides a conversion from a value of type A to a JsonObject.

Companion:
object
Source:
Encoder.scala
trait AsRoot[A]
trait Encoder[A]
trait Serializable
class Object
trait Matchable
class Any
trait AsObject[A]

Value members

Abstract methods

Convert a value to a JSON object.

Convert a value to a JSON object.

Source:
Encoder.scala

Concrete methods

final def apply(a: A): Json
final def contramapObject[B](f: B => A): AsObject[B]

Create a new Encoder.AsObject by applying a function to a value of type B before encoding as an A.

Create a new Encoder.AsObject by applying a function to a value of type B before encoding as an A.

Source:
Encoder.scala

Create a new Encoder.AsObject by applying a function to the output of this one.

Create a new Encoder.AsObject by applying a function to the output of this one.

Source:
Encoder.scala

Inherited methods

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 an A.

Create a new Encoder by applying a function to a value of type B before encoding as an A.

Inherited from:
Encoder
Source:
Encoder.scala
final def mapJson(f: Json => Json): Encoder[A]

Create a new Encoder by applying a function to the output of this one.

Create a new Encoder by applying a function to the output of this one.

Inherited from:
Encoder
Source:
Encoder.scala