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

com.rethinkdb.gen.proto.ResponseNote Maven / Gradle / Ivy

There is a newer version: 2.3.2.20160729
Show newest version
// Autogenerated by metajava.py.
// Do not edit this file directly.
// The template for this file is located at:
// ../../../../../../../../templates/proto/ResponseNote.java

package com.rethinkdb.gen.proto;

import java.util.Optional;

public enum ResponseNote {

    SEQUENCE_FEED(1),
    ATOM_FEED(2),
    ORDER_BY_LIMIT_FEED(3),
    UNIONED_FEED(4),
    INCLUDES_STATES(5);

    public final int value;

    private ResponseNote(int value){
        this.value = value;
    }

    public static ResponseNote fromValue(int value) {
        switch (value) {
            case 1: return ResponseNote.SEQUENCE_FEED;
            case 2: return ResponseNote.ATOM_FEED;
            case 3: return ResponseNote.ORDER_BY_LIMIT_FEED;
            case 4: return ResponseNote.UNIONED_FEED;
            case 5: return ResponseNote.INCLUDES_STATES;
            default:
                throw new IllegalArgumentException(String.format(
                "%s is not a legal value for ResponseNote", value));
        }
    }

    public static Optional maybeFromValue(int value) {
        try {
            return Optional.of(fromValue(value));
        } catch (IllegalArgumentException iae) {
            return Optional.empty();
        }
    }

    public boolean isFeed() {
        switch(this) {
            case SEQUENCE_FEED: return true;
            case ATOM_FEED: return true;
            case ORDER_BY_LIMIT_FEED: return true;
            case UNIONED_FEED: return true;
            default: return false;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy