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

com.quotemedia.streamer.client.impl.PayloadDecoderProvider 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 PayloadDecoderProvider {
    private final QmciMessageFactory qmci;
    private final ObjectMapper json;

    public PayloadDecoderProvider(
            final QmciMessageFactory qmci,
            final ObjectMapper json
    ) {
        this.qmci = checkNotNull(qmci);
        this.json = checkNotNull(json);
    }

    public PayloadDecoder get(final String format) {
        if (MimeTypes.QITCH.equals(format)) {
            return new DecodedPayloadDecoder();
        } else {
            return new TextPayloadDecoder(this.qmci, this.json);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy