Interface DataTransformer<FROM,TO>

Type Parameters:
FROM - Data type this transformer receives
TO - Type of transformed data

public interface DataTransformer<FROM,TO>
Transforms or processes data before it is given to subscribed DataObservers. A transformer is set via SubscriptionBuilder.transform(DataTransformer).

Note that a transformer is not required to actually "transform" any data. Technically, it's fine to return the same data it received and just do some processing with it.

Threading notes: transformations are executed sequentially on a background thread owned by the subscription publisher. It is OK to perform long lasting operations, however this will block notifications to all other observers until finished.

  • Method Summary

    Modifier and Type
    Method
    Description
    transform(FROM source)
    Transforms/processes the given data.