MapTo

com.rallyhealth.weepickle.v1.core.Types.To.MapTo
abstract class MapTo[-T, V, Z](delegatedTo: Visitor[T, V]) extends MapTo[T, V, Z], To[Z]

Attributes

Graph
Supertypes
trait To[Z]
class MapTo[T, V, Z]
trait Visitor[Any, Z]
trait AutoCloseable
class Object
trait Matchable
class Any
Show all

Members list

Value members

Abstract methods

def mapNonNullsFunction(t: V): Z

Concrete methods

override def visitArray(length: Int): ArrVisitor[Any, Z]

Attributes

Returns

a Visitor used for visiting the elements of the array

Definition Classes
override def visitObject(length: Int): ObjVisitor[Any, Z]

Attributes

Returns

a ObjVisitor used for visiting the keys/values of the object

Definition Classes

Inherited methods

override def close(): Unit

==Responsibility== Generally, whoever creates the visitor should be responsible for closing it, i.e. not intermediate transform(v: Visitor) methods themselves.

==Responsibility== Generally, whoever creates the visitor should be responsible for closing it, i.e. not intermediate transform(v: Visitor) methods themselves.

==Self Closing== Given that common usage is most often single-valued (e.g. "{}"), rather than multi-valued (e.g. "{} {} {}"), Visitors may self-close (e.g. visitor.map{v => Try(v.close); v)} after a single value to prevent resource leaks, but are encouraged to expose both forms (i.e. single/multiple), if supportable.

==Multiple close() calls/Idempotency== Visitors are encouraged to respond gracefully if close() is called multiple times. If an underlying resource would throw if already closed, this may mean adding a private var isClosed: Boolean field to prevent multiple calls.

Attributes

Definition Classes
MapTo -> Visitor -> AutoCloseable
Inherited from:
MapTo
override def map[Z](f: Z => Z): To[Z]

Attributes

Definition Classes
To -> Visitor
Inherited from:
To
def mapFunction(v: V): Z

Attributes

Inherited from:
MapTo
override def mapNulls[Z](f: Z => Z): To[Z]

Attributes

Definition Classes
To -> Visitor
Inherited from:
To
def narrow[K <: Z]: To[K]

Attributes

Inherited from:
To
override def visitBinary(bytes: Array[Byte], offset: Int, len: Int): Z

Raw bytes.

Raw bytes.

Attributes

Definition Classes
Inherited from:
MapTo
override def visitChar(c: Char): Z

Attributes

Definition Classes
Inherited from:
MapTo
override def visitExt(tag: Byte, bytes: Array[Byte], offset: Int, len: Int): Z

MsgPack extension type.

MsgPack extension type.

Attributes

Definition Classes
Inherited from:
MapTo
override def visitFalse(): Z

Attributes

Definition Classes
Inherited from:
MapTo
override def visitFloat32(d: Float): Z

Attributes

Definition Classes
Inherited from:
MapTo
override def visitFloat64(d: Double): Z

Optional handler for raw double values; can be overriden for performance in cases where you're translating directly between numbers to avoid the overhead of stringifying and re-parsing your numbers (e.g. the WebJson transformer gets raw doubles from the underlying Json.parse).

Optional handler for raw double values; can be overriden for performance in cases where you're translating directly between numbers to avoid the overhead of stringifying and re-parsing your numbers (e.g. the WebJson transformer gets raw doubles from the underlying Json.parse).

Delegates to visitFloat64StringParts if not overriden

Value parameters

d

the input number

Attributes

Definition Classes
Inherited from:
MapTo
override def visitFloat64String(s: String): Z

Convenience methods to help you compute the decimal-point-index and exponent-index of an arbitrary numeric string

Convenience methods to help you compute the decimal-point-index and exponent-index of an arbitrary numeric string

Value parameters

s

the text string being visited

Attributes

Definition Classes
Inherited from:
MapTo
override def visitFloat64StringParts(cs: CharSequence, decIndex: Int, expIndex: Int): Z

Visit the number in its text representation.

Visit the number in its text representation.

Value parameters

cs

unparsed text representation of the number.

decIndex

index of the ., relative to the start of the CharSequence, or -1 if omitted

expIndex

index of e or E relative to the start of the CharSequence, or -1 if omitted

Attributes

Definition Classes
Inherited from:
MapTo
override def visitInt32(i: Int): Z

Attributes

Definition Classes
Inherited from:
MapTo
override def visitInt64(l: Long): Z

Attributes

Definition Classes
Inherited from:
MapTo
override def visitNull(): Z

Attributes

Definition Classes
Inherited from:
MapTo
override def visitString(cs: CharSequence): Z

Value parameters

cs

the text string being visited

Attributes

Definition Classes
Inherited from:
MapTo
override def visitTimestamp(instant: Instant): Z

Attributes

Definition Classes
Inherited from:
MapTo
override def visitTrue(): Z

Attributes

Definition Classes
Inherited from:
MapTo
override def visitUInt64(ul: Long): Z

Attributes

Definition Classes
Inherited from:
MapTo