trait JsonEncoder[A] extends JsonEncoderPlatformSpecific[A]
- Self Type
- JsonEncoder[A]
- Alphabetic
- By Inheritance
- JsonEncoder
- JsonEncoderPlatformSpecific
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
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 asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def contramap[B](f: (B) => A): JsonEncoder[B]
Returns a new encoder, with a new input type, which can be transformed to the old input type by the specified user-defined function.
- final def either[B](that: => JsonEncoder[B]): JsonEncoder[Either[A, B]]
Returns a new encoder that can accepts an
Either[A, B]
to either, and uses either this encoder or the specified encoder to encode the two different types of values. - final def eitherWith[B, C](that: => JsonEncoder[B])(f: (C) => Either[A, B]): JsonEncoder[C]
Returns a new encoder with a new input type, which can be transformed to either the input type of this encoder, or the input type of the specified encoder, using the user-defined transformation function.
- final def encodeJson(a: A, indent: Option[Int] = None): CharSequence
Encodes the specified value into a JSON string, with the specified indentation level.
- final val encodeJsonArrayPipeline: ZPipeline[Any, Throwable, A, Char]
- Definition Classes
- JsonEncoderPlatformSpecific
- final val encodeJsonLinesPipeline: ZPipeline[Any, Throwable, A, Char]
- Definition Classes
- JsonEncoderPlatformSpecific
- final def encodeJsonStream(a: A): ZStream[Any, Throwable, Char]
Encodes the specified value into a character stream.
Encodes the specified value into a character stream.
- Definition Classes
- JsonEncoderPlatformSpecific
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isNothing(a: A): Boolean
This default may be overriden when this value may be missing within a JSON object and still be encoded.
This default may be overriden when this value may be missing within a JSON object and still be encoded.
- Annotations
- @nowarn()
- final def narrow[B <: A]: JsonEncoder[B]
Returns this encoder but narrowed to the its given sub-type
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def orElseEither[B](that: => JsonEncoder[B]): JsonEncoder[Either[A, B]]
Returns a new encoder that can accepts an
Either[A, B]
to either, and uses either this encoder or the specified encoder to encode the two different types of values.Returns a new encoder that can accepts an
Either[A, B]
to either, and uses either this encoder or the specified encoder to encode the two different types of values. The difference with the classiceither
encoder is that the resulting JSON has no fieldLeft
orRight
. What should be:{"Right": "John Doe"}
is encoded as"John Doe"
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toJsonAST(a: A): Either[String, Json]
Converts a value to a Json AST
Converts a value to a Json AST
The default implementation encodes the value to a Json byte stream and uses decode to parse that back to an AST. Override to provide a more performant implementation.
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def zip[B](that: => JsonEncoder[B]): JsonEncoder[(A, B)]
Returns a new encoder that is capable of encoding a tuple containing the values of this encoder and the specified encoder.
- final def zipWith[B, C](that: => JsonEncoder[B])(f: (C) => (A, B)): JsonEncoder[C]
Returns a new encoder that is capable of encoding a user-defined value, which is create from a tuple of the values of this encoder and the specified encoder, from the specified user- defined function.