KeyEncoder

io.circe.KeyEncoder
See theKeyEncoder companion object
trait KeyEncoder[A] extends Serializable

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

This type class will be used to create strings for JSON keys when encoding Map[A, ?] instances as JSON.

Note that if more than one value maps to the same string, the resulting JSON object may have fewer fields than the original map.

Attributes

Companion:
object
Source:
KeyEncoder.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Value members

Abstract methods

def apply(key: A): String

Convert a key value to a string.

Convert a key value to a string.

Attributes

Source:
KeyEncoder.scala

Concrete methods

final def contramap[B](f: B => A): KeyEncoder[B]

Construct an instance for type B from an instance for type A.

Construct an instance for type B from an instance for type A.

Attributes

Source:
KeyEncoder.scala