com.gojek.courier.StreamAdapter.kt Maven / Gradle / Ivy
package com.gojek.courier
import java.lang.reflect.Type
/**
* Adapts a [Stream] into another type.
*/
interface StreamAdapter {
/**
* Returns an object that delegates to [stream].
*/
fun adapt(stream: Stream): R
/**
* Creates [MessageAdapter] instances based on the return type of [the service interface][Courier.create] methods.
*/
interface Factory {
/**
* Returns a [StreamAdapter] for adapting an [type] into another type, throws an exception if [type] cannot be
* handled by this factory.
*/
fun create(type: Type): StreamAdapter
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy