JsonSupport

com.netflix.atlas.json.JsonSupport
trait JsonSupport

Trait that adds methods to easily encode the object to JSON. Can be used to indicate a type that has a known mapping to JSON format.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def encode(gen: JsonGenerator): Unit

Encode this object as JSON. By default it will just use Json.encode. This method can be overridden to customize the format or to provide a more performance implementation. When using a custom format, the subclass should also override hasCustomEncoding to return true. This will cause Json.encode to use the custom implementation rather than the default serializer for the type.

Encode this object as JSON. By default it will just use Json.encode. This method can be overridden to customize the format or to provide a more performance implementation. When using a custom format, the subclass should also override hasCustomEncoding to return true. This will cause Json.encode to use the custom implementation rather than the default serializer for the type.

Attributes

def hasCustomEncoding: Boolean

Returns true if a custom encoding is used that does not rely on Json.encode.

Returns true if a custom encoding is used that does not rely on Json.encode.

Attributes

final def toJson: String

Returns a JSON string representing this object.

Returns a JSON string representing this object.

Attributes