1 /* 2 * Copyright 2019 The Grafeas Authors. All rights reserved. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 // Generated by the protocol buffer compiler. DO NOT EDIT! 18 // source: grafeas/v1/cvss.proto 19 20 package io.grafeas.v1; 21 22 /** 23 * 24 * 25 * <pre> 26 * CVSS Version. 27 * </pre> 28 * 29 * Protobuf enum {@code grafeas.v1.CVSSVersion} 30 */ 31 public enum CVSSVersion implements com.google.protobuf.ProtocolMessageEnum { 32 /** <code>CVSS_VERSION_UNSPECIFIED = 0;</code> */ 33 CVSS_VERSION_UNSPECIFIED(0), 34 /** <code>CVSS_VERSION_2 = 1;</code> */ 35 CVSS_VERSION_2(1), 36 /** <code>CVSS_VERSION_3 = 2;</code> */ 37 CVSS_VERSION_3(2), 38 UNRECOGNIZED(-1), 39 ; 40 41 /** <code>CVSS_VERSION_UNSPECIFIED = 0;</code> */ 42 public static final int CVSS_VERSION_UNSPECIFIED_VALUE = 0; 43 /** <code>CVSS_VERSION_2 = 1;</code> */ 44 public static final int CVSS_VERSION_2_VALUE = 1; 45 /** <code>CVSS_VERSION_3 = 2;</code> */ 46 public static final int CVSS_VERSION_3_VALUE = 2; 47 getNumber()48 public final int getNumber() { 49 if (this == UNRECOGNIZED) { 50 throw new java.lang.IllegalArgumentException( 51 "Can't get the number of an unknown enum value."); 52 } 53 return value; 54 } 55 56 /** 57 * @param value The numeric wire value of the corresponding enum entry. 58 * @return The enum associated with the given numeric wire value. 59 * @deprecated Use {@link #forNumber(int)} instead. 60 */ 61 @java.lang.Deprecated valueOf(int value)62 public static CVSSVersion valueOf(int value) { 63 return forNumber(value); 64 } 65 66 /** 67 * @param value The numeric wire value of the corresponding enum entry. 68 * @return The enum associated with the given numeric wire value. 69 */ forNumber(int value)70 public static CVSSVersion forNumber(int value) { 71 switch (value) { 72 case 0: 73 return CVSS_VERSION_UNSPECIFIED; 74 case 1: 75 return CVSS_VERSION_2; 76 case 2: 77 return CVSS_VERSION_3; 78 default: 79 return null; 80 } 81 } 82 internalGetValueMap()83 public static com.google.protobuf.Internal.EnumLiteMap<CVSSVersion> internalGetValueMap() { 84 return internalValueMap; 85 } 86 87 private static final com.google.protobuf.Internal.EnumLiteMap<CVSSVersion> internalValueMap = 88 new com.google.protobuf.Internal.EnumLiteMap<CVSSVersion>() { 89 public CVSSVersion findValueByNumber(int number) { 90 return CVSSVersion.forNumber(number); 91 } 92 }; 93 getValueDescriptor()94 public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { 95 if (this == UNRECOGNIZED) { 96 throw new java.lang.IllegalStateException( 97 "Can't get the descriptor of an unrecognized enum value."); 98 } 99 return getDescriptor().getValues().get(ordinal()); 100 } 101 getDescriptorForType()102 public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { 103 return getDescriptor(); 104 } 105 getDescriptor()106 public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { 107 return io.grafeas.v1.CVSSProto.getDescriptor().getEnumTypes().get(0); 108 } 109 110 private static final CVSSVersion[] VALUES = values(); 111 valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)112 public static CVSSVersion valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { 113 if (desc.getType() != getDescriptor()) { 114 throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); 115 } 116 if (desc.getIndex() == -1) { 117 return UNRECOGNIZED; 118 } 119 return VALUES[desc.getIndex()]; 120 } 121 122 private final int value; 123 CVSSVersion(int value)124 private CVSSVersion(int value) { 125 this.value = value; 126 } 127 128 // @@protoc_insertion_point(enum_scope:grafeas.v1.CVSSVersion) 129 } 130