io.nadron.convert.Transform Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nadclient Show documentation
Show all versions of nadclient Show documentation
This is a client library for Nadron server https://github.com/menacher/java-game-server/tree/netty4/nadron. Java clients can use this program to connect and interact with nadron server.
package io.nadron.convert;
import io.nadron.client.communication.MessageBuffer;
/**
* A generic interface for transforming one object to another. Implementations
* of this interface can be used for decoding and encoding objects, maybe while
* reading from a {@link MessageBuffer} or writing to a Netty channel.
*
* @author Abraham Menacherry
*
* @param
* @param
*/
public interface Transform
{
/**
* Convert Object of type T to type V.
*
* @param object
* The incoming object, mostly a buffer or byte array.
* @return Returns the converted object.
* @throws Exception
*/
V convert(T object) throws Exception;
}