package krpc.client.services;

import com.google.protobuf.ByteString;

import krpc.client.Connection;
import krpc.client.Encoder;
import krpc.client.RemoteEnum;
import krpc.client.RemoteObject;
import krpc.client.RPCInfo;
import krpc.client.RPCException;
import krpc.client.Types;

// Generated code references its own deprecated members (e.g. when registering
// exception types), so suppress the deprecation warnings within this class.
@SuppressWarnings("deprecation")
public class EmptyService {

    public static EmptyService newInstance(Connection connection) {
        return new EmptyService(connection);
    }

    private Connection connection;

    private EmptyService(Connection connection) {
        this.connection = connection;
    }

    private void addExceptionTypes(Connection connection) {
    }

    public static class _Types {
        // Procedure return and parameter types are held in lookup maps that are
        // populated by chunked initializer methods. Emitting them this way keeps
        // every generated method under the JVM's 64KB bytecode limit as a service
        // accumulates procedures.
        private static final java.util.Map<String, krpc.schema.KRPC.Type> RETURN_TYPES =
            new java.util.HashMap<String, krpc.schema.KRPC.Type>();
        private static final java.util.Map<String, krpc.schema.KRPC.Type[]> PARAMETER_TYPES =
            new java.util.HashMap<String, krpc.schema.KRPC.Type[]>();

        static {
        }

        public static krpc.schema.KRPC.Type getReturnType(String procedure) {
            if (!RETURN_TYPES.containsKey(procedure))
                throw new IllegalArgumentException("Procedure '" + procedure +"' not found");
            return RETURN_TYPES.get(procedure);
        }

        public static krpc.schema.KRPC.Type[] getParameterTypes(String procedure) {
            krpc.schema.KRPC.Type[] parameterTypes = PARAMETER_TYPES.get(procedure);
            if (parameterTypes == null)
                throw new IllegalArgumentException("Procedure '" + procedure +"' not found");
            return parameterTypes;
        }
    }
}
