1 /* 2 * Copyright 2020 Google LLC 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 // Generated by the protocol buffer compiler. DO NOT EDIT! 17 // source: google/cloud/vision/v1/image_annotator.proto 18 19 package com.google.cloud.vision.v1; 20 21 /** 22 * 23 * 24 * <pre> 25 * A bucketized representation of likelihood, which is intended to give clients 26 * highly stable results across model upgrades. 27 * </pre> 28 * 29 * Protobuf enum {@code google.cloud.vision.v1.Likelihood} 30 */ 31 public enum Likelihood implements com.google.protobuf.ProtocolMessageEnum { 32 /** 33 * 34 * 35 * <pre> 36 * Unknown likelihood. 37 * </pre> 38 * 39 * <code>UNKNOWN = 0;</code> 40 */ 41 UNKNOWN(0), 42 /** 43 * 44 * 45 * <pre> 46 * It is very unlikely. 47 * </pre> 48 * 49 * <code>VERY_UNLIKELY = 1;</code> 50 */ 51 VERY_UNLIKELY(1), 52 /** 53 * 54 * 55 * <pre> 56 * It is unlikely. 57 * </pre> 58 * 59 * <code>UNLIKELY = 2;</code> 60 */ 61 UNLIKELY(2), 62 /** 63 * 64 * 65 * <pre> 66 * It is possible. 67 * </pre> 68 * 69 * <code>POSSIBLE = 3;</code> 70 */ 71 POSSIBLE(3), 72 /** 73 * 74 * 75 * <pre> 76 * It is likely. 77 * </pre> 78 * 79 * <code>LIKELY = 4;</code> 80 */ 81 LIKELY(4), 82 /** 83 * 84 * 85 * <pre> 86 * It is very likely. 87 * </pre> 88 * 89 * <code>VERY_LIKELY = 5;</code> 90 */ 91 VERY_LIKELY(5), 92 UNRECOGNIZED(-1), 93 ; 94 95 /** 96 * 97 * 98 * <pre> 99 * Unknown likelihood. 100 * </pre> 101 * 102 * <code>UNKNOWN = 0;</code> 103 */ 104 public static final int UNKNOWN_VALUE = 0; 105 /** 106 * 107 * 108 * <pre> 109 * It is very unlikely. 110 * </pre> 111 * 112 * <code>VERY_UNLIKELY = 1;</code> 113 */ 114 public static final int VERY_UNLIKELY_VALUE = 1; 115 /** 116 * 117 * 118 * <pre> 119 * It is unlikely. 120 * </pre> 121 * 122 * <code>UNLIKELY = 2;</code> 123 */ 124 public static final int UNLIKELY_VALUE = 2; 125 /** 126 * 127 * 128 * <pre> 129 * It is possible. 130 * </pre> 131 * 132 * <code>POSSIBLE = 3;</code> 133 */ 134 public static final int POSSIBLE_VALUE = 3; 135 /** 136 * 137 * 138 * <pre> 139 * It is likely. 140 * </pre> 141 * 142 * <code>LIKELY = 4;</code> 143 */ 144 public static final int LIKELY_VALUE = 4; 145 /** 146 * 147 * 148 * <pre> 149 * It is very likely. 150 * </pre> 151 * 152 * <code>VERY_LIKELY = 5;</code> 153 */ 154 public static final int VERY_LIKELY_VALUE = 5; 155 getNumber()156 public final int getNumber() { 157 if (this == UNRECOGNIZED) { 158 throw new java.lang.IllegalArgumentException( 159 "Can't get the number of an unknown enum value."); 160 } 161 return value; 162 } 163 164 /** 165 * @param value The numeric wire value of the corresponding enum entry. 166 * @return The enum associated with the given numeric wire value. 167 * @deprecated Use {@link #forNumber(int)} instead. 168 */ 169 @java.lang.Deprecated valueOf(int value)170 public static Likelihood valueOf(int value) { 171 return forNumber(value); 172 } 173 174 /** 175 * @param value The numeric wire value of the corresponding enum entry. 176 * @return The enum associated with the given numeric wire value. 177 */ forNumber(int value)178 public static Likelihood forNumber(int value) { 179 switch (value) { 180 case 0: 181 return UNKNOWN; 182 case 1: 183 return VERY_UNLIKELY; 184 case 2: 185 return UNLIKELY; 186 case 3: 187 return POSSIBLE; 188 case 4: 189 return LIKELY; 190 case 5: 191 return VERY_LIKELY; 192 default: 193 return null; 194 } 195 } 196 internalGetValueMap()197 public static com.google.protobuf.Internal.EnumLiteMap<Likelihood> internalGetValueMap() { 198 return internalValueMap; 199 } 200 201 private static final com.google.protobuf.Internal.EnumLiteMap<Likelihood> internalValueMap = 202 new com.google.protobuf.Internal.EnumLiteMap<Likelihood>() { 203 public Likelihood findValueByNumber(int number) { 204 return Likelihood.forNumber(number); 205 } 206 }; 207 getValueDescriptor()208 public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { 209 if (this == UNRECOGNIZED) { 210 throw new java.lang.IllegalStateException( 211 "Can't get the descriptor of an unrecognized enum value."); 212 } 213 return getDescriptor().getValues().get(ordinal()); 214 } 215 getDescriptorForType()216 public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { 217 return getDescriptor(); 218 } 219 getDescriptor()220 public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { 221 return com.google.cloud.vision.v1.ImageAnnotatorProto.getDescriptor().getEnumTypes().get(0); 222 } 223 224 private static final Likelihood[] VALUES = values(); 225 valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)226 public static Likelihood valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { 227 if (desc.getType() != getDescriptor()) { 228 throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); 229 } 230 if (desc.getIndex() == -1) { 231 return UNRECOGNIZED; 232 } 233 return VALUES[desc.getIndex()]; 234 } 235 236 private final int value; 237 Likelihood(int value)238 private Likelihood(int value) { 239 this.value = value; 240 } 241 242 // @@protoc_insertion_point(enum_scope:google.cloud.vision.v1.Likelihood) 243 } 244