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

bt.protocol.handler.UniqueMessageHandler Maven / Gradle / Ivy

There is a newer version: 1.10
Show newest version
package bt.protocol.handler;

import bt.protocol.Message;

import java.nio.ByteBuffer;
import java.util.Collection;
import java.util.Collections;

abstract class UniqueMessageHandler extends BaseMessageHandler {

    private Class type;
    private Collection> supportedTypes;

    protected UniqueMessageHandler(Class type) {
        this.type = type;
        supportedTypes = Collections.singleton(type);
    }

    @Override
    public Collection> getSupportedTypes() {
        return supportedTypes;
    }

    @Override
    public Class readMessageType(ByteBuffer buffer) {
        return type;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy