estonlabs.cxtl.exchanges.mexc.spot.v3.MEXCOutboundMessage Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cxtl Show documentation
Show all versions of cxtl Show documentation
CXTL – Crypto eXchange Trading Library
package estonlabs.cxtl.exchanges.mexc.spot.v3;
import com.fasterxml.jackson.annotation.JsonInclude;
import estonlabs.cxtl.common.stream.managed.OutboundMessage;
import estonlabs.cxtl.exchanges.mexc.spot.v3.domain.enums.WSMethod;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.List;
@Data
@Accessors(chain = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class MEXCOutboundMessage implements OutboundMessage {
private WSMethod method;
private List params;
@Override
public MessageType getMessageType() {
return switch (method){
case PING -> MessageType.PING;
case SUBSCRIPTION -> MessageType.SUBSCRIPTION;
case UNSUBSCRIPTION -> MessageType.UNSUBSCRIBE;
};
}
}