/** * Autogenerated by Thrift Compiler (0.9.2) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.xiaomi.infra.galaxy.talos.thrift; import java.util.Map; import java.util.HashMap; import libthrift091.TEnum; public enum Permission implements libthrift091.TEnum { /** * None permission; * */ NONE(0), /** * putMessages * */ PUT_MESSAGE(1), /** * getMessages * */ GET_MESSAGE(2), /** * PUT_MESSAGE and GET_MESSAGE; * */ FULL_MESSAGE_CONTROL(3), /** * describeTopic; * */ DESCRIBE_TOPIC(4), /** * PUT_MESSAGE and DESCRIBE_TOPIC * */ PUT_MESSAGE_AND_DESCRIBE_TOPIC(5), /** * GET_MESSAGE and DESCRIBE_TOPIC * */ GET_MESSAGE_AND_DESCRIBE_TOPIC(6), /** * Topic read and Message full control; * */ TOPIC_READ_AND_MESSAGE_FULL_CONTROL(7), /** * deleteTopic and changeTopicAttribute; * */ CHANGE_TOPIC(8), /** * DESCRIBE_TOPIC and CHANGE_TOPIC; * */ FULL_TOPIC_CONTROL(12), /** * FULL_MESSAGE_CONTROL and FULL_TOPIC_CONTROL * */ FULL_CONTROL(15), /** * setPermission, revokePermission, only owner of the topic and Talos admin * has CHANGE_PERMISSION/CHANGE_TOPIC permission by default; * One can't add CHANGE_PERMISSION/CHANGE_TOPIC to a accountId, or you can't * revoke CHANGE_PERMISSION/CHANGE_TOPIC from the topic owner; * */ CHANGE_PERMISSION(16), /** * FULL_CONTROL and CHANGE_PERMISSION, only owner of the topic and Talos admin * have ADMIN permission by default. * */ ADMIN(31); private final int value; private Permission(int value) { this.value = value; } /** * Get the integer value of this enum value, as defined in the Thrift IDL. */ public int getValue() { return value; } /** * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ public static Permission findByValue(int value) { switch (value) { case 0: return NONE; case 1: return PUT_MESSAGE; case 2: return GET_MESSAGE; case 3: return FULL_MESSAGE_CONTROL; case 4: return DESCRIBE_TOPIC; case 5: return PUT_MESSAGE_AND_DESCRIBE_TOPIC; case 6: return GET_MESSAGE_AND_DESCRIBE_TOPIC; case 7: return TOPIC_READ_AND_MESSAGE_FULL_CONTROL; case 8: return CHANGE_TOPIC; case 12: return FULL_TOPIC_CONTROL; case 15: return FULL_CONTROL; case 16: return CHANGE_PERMISSION; case 31: return ADMIN; default: return null; } } }