vertx / io.vertx.rx.java / RxHelper / unmarshaller

unmarshaller

open static fun <T : Any> unmarshaller(mappedType: Class<T>, mapper: ObjectMapper): Operator<T, Buffer>

Returns a unmarshaller for the specified java type as a rx.Observable.Operator instance given the the provided com.fasterxml.jackson.databind.ObjectMapper The marshaller can be used with the Observable#lift(rx.Observable.Operator) method to transform a Observable<Buffer> into a Observable<T>. The unmarshaller buffers the content until onComplete is called, then unmarshalling happens. Note that the returned observable will emit at most a single object.

Parameters

mappedType - the type to unmarshall

mapper - the mapper to use to unmarshell

Return
the unmarshaller operator

open static fun <T : Any> unmarshaller(mappedType: Class<T>): Operator<T, Buffer>

Returns a json unmarshaller for the specified java type as a rx.Observable.Operator instance. The marshaller can be used with the Observable#lift(rx.Observable.Operator) method to transform a Observable<Buffer> into a Observable<T>. The unmarshaller buffers the content until onComplete is called, then unmarshalling happens. Note that the returned observable will emit at most a single object.

Parameters

mappedType - the type to unmarshall

Return
the unmarshaller operator

open static fun <T : Any> unmarshaller(mappedTypeRef: TypeReference<T>): Operator<T, Buffer>

Returns a json unmarshaller for the specified java type as a rx.Observable.Operator instance. The marshaller can be used with the rx.Observable#lift(rx.Observable.Operator) method to transform a Observable<Buffer> into a Observable<T>. The unmarshaller buffers the content until onComplete is called, then unmarshalling happens. Note that the returned observable will emit at most a single object.

Parameters

mappedTypeRef - the type reference to unmarshall

Return
the unmarshaller operator

open static fun <T : Any> unmarshaller(mappedTypeRef: TypeReference<T>, mapper: ObjectMapper): Operator<T, Buffer>

Returns a unmarshaller for the specified java type as a rx.Observable.Operator instance given the the provided com.fasterxml.jackson.databind.ObjectMapper The marshaller can be used with the rx.Observable#lift(rx.Observable.Operator) method to transform a Observable<Buffer> into a Observable<T>. The unmarshaller buffers the content until onComplete is called, then unmarshalling happens. Note that the returned observable will emit at most a single object.

Parameters

mappedTypeRef - the type reference to unmarshall

Return
the unmarshaller operator