Contains readers for maps where there is no DBKeyCodec for key type.
Typeclass which expresses ability to convert between MongoDB JSON object keys and values of some type.
Typeclass which expresses ability to convert between MongoDB JSON object keys and values of some type. Every type which has a natural, unambiguous string representation should have a DBKeyCodec.
Represents an abstract source from which a value may be deserialized (read).
Represents an abstract source from which a value may be deserialized (read).
Each of the read
methods returns an instance of ValueRead which may contain either a successfully read
value or an error message.
An Input value should be assumed to be stateful. If any of the read
methods have already been called AND
returned successful result ((ReadSuccessful), the Input instance can no longer be used and MUST be discarded.
On the other hand, when the read
method returned a ReadFailed, its state should be unchanged and any read
method may be called again.
In order to ignore the value kept in this Input, skip()
MUST be called.
In summary: every Input MUST be fully exhausted by either calling one of the read
methods which returns
successful value or by calling skip()
. Also, ListInput and ObjectInput instances returned from this
Input must also be fully exhausted on their own.
Represents an abstract source of sequence of values that can be deserialized.
Represents an abstract source of sequence of values that can be deserialized.
ListInput instance is stateful and MUST be read strictly sequentially. This means, you MUST fully exhaust
an Input instance returned by nextElement()
before calling nextElement()
again. For this reason,
ListInput is not an Iterator
despite having similar interface
(Iterator
would easily allow e.g. conversion to List[Input]
which would be illegal).
ListInput MUST always be fully exhausted. In order to ignore any remaining elements, skipRemaining() may be used.
Represents an abstract sink for serialization of sequences of values.
Represents an abstract sink for serialization of sequences of values. Any ListOutput instance
must be assumed to be stateful and used in strictly sequential manner. After all elements have been written,
finish()
must be called to explicitly mark that the list is complete.
Represents an abstract source of key-value mappings that can be deserialized.
Represents an abstract source of key-value mappings that can be deserialized.
ObjectInput instance is stateful and MUST be read strictly sequentially. This means, you MUST fully exhaust
any Input instance returned by nextField()
before calling nextField()
again. For this reason,
ObjectInput is not an Iterator
despite having similar interface
(Iterator
would easily allow e.g. conversion to List[(String, Input)]
which would be illegal).
ObjectInput MUST always be fully exhausted. In order to ignore any remaining key-value mappings,
skipRemaining()
may be used.
NOTE: The order of keys returned by subsequent invocations of nextField()
may be arbitrary and in particular
may not match the order in which keys were written to corresponding ObjectOutput.
Represents an abstract sink for serialization of string-to-value mappings.
Represents an abstract sink for serialization of string-to-value mappings. Any ObjectOutput instance
must be assumed to be stateful and used in strictly sequential manner. After all key-value pairs have been
written, finish()
must be called to explicitly mark that the object is complete.
Represents an abstract sink to which a value may be serialized (written).
Represents an abstract sink to which a value may be serialized (written).
An Output instance should be assumed to be stateful. After calling any of the write
methods, it MUST NOT be
reused. This means that Output instance can be used only to write a single value. However, if the value
to write is complex, one can use writeList
/writeSet
or writeObject
/writeMap
.
Base trait for outputs which allow writing of multiple values in sequence, i.e.
Base trait for outputs which allow writing of multiple values in sequence, i.e. ListOutput and ObjectOutput.
Author: ghik Created: 19/11/15.
This is pretty much the same thing as Try
but more lightweight -
it simply holds an error message instead of a whole exception with stack trace etc.
Contains readers for maps where there is no DBKeyCodec for key type. In such case, we assume reading from a list of key-value pairs instead of JSON object.