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

protobuf_unittest.EnumWithNoOuter Maven / Gradle / Ivy

The newest version!
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: com/google/protobuf/multiple_files_test.proto

package protobuf_unittest;

/**
 * Protobuf enum {@code protobuf_unittest.EnumWithNoOuter}
 */
public enum EnumWithNoOuter
    implements com.google.protobuf.ProtocolMessageEnum {
  /**
   * FOO = 1;
   */
  FOO(0, 1),
  /**
   * BAR = 2;
   */
  BAR(1, 2),
  ;

  /**
   * FOO = 1;
   */
  public static final int FOO_VALUE = 1;
  /**
   * BAR = 2;
   */
  public static final int BAR_VALUE = 2;


  public final int getNumber() { return value; }

  public static EnumWithNoOuter valueOf(int value) {
    switch (value) {
      case 1: return FOO;
      case 2: return BAR;
      default: return null;
    }
  }

  public static com.google.protobuf.Internal.EnumLiteMap
      internalGetValueMap() {
    return internalValueMap;
  }
  private static com.google.protobuf.Internal.EnumLiteMap
      internalValueMap =
        new com.google.protobuf.Internal.EnumLiteMap() {
          public EnumWithNoOuter findValueByNumber(int number) {
            return EnumWithNoOuter.valueOf(number);
          }
        };

  public final com.google.protobuf.Descriptors.EnumValueDescriptor
      getValueDescriptor() {
    return getDescriptor().getValues().get(index);
  }
  public final com.google.protobuf.Descriptors.EnumDescriptor
      getDescriptorForType() {
    return getDescriptor();
  }
  public static final com.google.protobuf.Descriptors.EnumDescriptor
      getDescriptor() {
    try {
      java.lang.Class immutableFileClass =
          java.lang.Class.forName("protobuf_unittest.MultipleFilesTestProto");
      @java.lang.SuppressWarnings("unchecked")
      java.lang.reflect.Method m =
          immutableFileClass.getMethod("getDescriptor");
      com.google.protobuf.Descriptors.FileDescriptor file =
          (com.google.protobuf.Descriptors.FileDescriptor)
              m.invoke(immutableFileClass);
      return file.getEnumTypes().get(0);
    } catch (Exception e) {
    }
    return protobuf_unittest.MultipleFilesTestProto.getDescriptor()
        .getEnumTypes().get(0);
  }

  private static final EnumWithNoOuter[] VALUES = values();

  public static EnumWithNoOuter valueOf(
      com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
    if (desc.getType() != getDescriptor()) {
      throw new java.lang.IllegalArgumentException(
        "EnumValueDescriptor is not for this type.");
    }
    return VALUES[desc.getIndex()];
  }

  private final int index;
  private final int value;

  private EnumWithNoOuter(int index, int value) {
    this.index = index;
    this.value = value;
  }

  // @@protoc_insertion_point(enum_scope:protobuf_unittest.EnumWithNoOuter)
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy