package net.anomalyxii.bot.stub.server;

import net.anomalyxii.bot.api.server.Protocol;
import net.anomalyxii.bot.api.server.ProtocolInstance;
import net.anomalyxii.bot.api.server.ServerContext;
import net.anomalyxii.bot.api.server.strategies.*;
import net.anomalyxii.bot.stub.server.strategies.NoopReceiveStrategy;
import net.anomalyxii.bot.stub.server.strategies.NoopTransmitStrategy;

/**
 * A stub {@link Protocol}.
 *
 * Created by Anomaly on 12/05/2017.
 */
public class StubProtocolInstance implements ProtocolInstance<Void, StubProtocolInstance> {

    // ******************************
    // Protocol Methods
    // ******************************

    @Override
    public Class<Void> getRawType() {
        return Void.class;
    }

    @Override
    public ParseStrategy<Void> getParseStrategy() {
        return null;
    }

    @Override
    public FormatStrategy<Void> getFormatStrategy() {
        return null;
    }

    // ******************************
    // ProtocolInstance Methods
    // ******************************

    @Override
    public StubProtocolInstance getProtocol() {
        return this;
    }

    @Override
    public ReceiveStrategy getReceiveStrategy() {
        return new NoopReceiveStrategy();
    }

    @Override
    public TransmitStrategy getTransmitStrategy() {
        return new NoopTransmitStrategy();
    }

    @Override
    public ServerContext getServerContext() {
        return new StubServerContext();
    }

}
