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

org.tarantool.Key Maven / Gradle / Ivy

There is a newer version: 1.9.4
Show newest version
package org.tarantool;


import java.util.concurrent.Callable;

public enum Key implements Callable {
    //header
    CODE(0x00), SYNC(0x01),  SCHEMA_ID(0x05),

    //body
    SPACE(0x10), INDEX(0x11),
    LIMIT(0x12), OFFSET(0x13),
    ITERATOR(0x14),

    KEY(0x20),
    TUPLE(0x21), FUNCTION(0x22),
    USER_NAME(0x23),EXPRESSION(0x27),
    UPSERT_OPS(0x28),
    DATA(0x30), ERROR(0x31);

    int id;

    Key(int id) {
        this.id = id;
    }

    public int getId() {
        return id;
    }

    public static Key getById(int id) {
        for (Key key : Key.values()) {
            if (id == key.id) {
                return key;
            }
        }
        return null;
    }


    @Override
    public Integer call() throws Exception {
        return id;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy