All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.quotemedia.streamer.client.impl.PayloadEncoderProvider Maven / Gradle / Ivy

Go to download

Java streaming client that provides easy-to-use client APIs to connect and subscribe to QuoteMedia's market data streaming services. https://quotemedia.com/

The newest version!
package com.quotemedia.streamer.client.impl;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.quotemedia.streamer.messages.MimeTypes;

import static com.quotemedia.qitch.Preconditions.checkNotNull;

public class PayloadEncoderProvider {
    private final ObjectMapper json;

    public PayloadEncoderProvider(final ObjectMapper json) {
        this.json = checkNotNull(json);
    }

    public PayloadEncoder get(final String format) {
        if (MimeTypes.QITCH.equals(format)) {
            return new DecodedPayloadEncoder();
        } else {
            return new TextPayloadEncoder(this.json);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy