MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / parseSearchType

Method parseSearchType

src/search/SearchQuery.java:156–176  ·  view source on GitHub ↗

Converts the human readable string to the proper enum @param type The string to parse @return The parsed enum @throws IllegalArgumentException if the type is missing or wsa not recognized

(final String type)

Source from the content-addressed store, hash-verified

154 * recognized
155 */
156 public static SearchType parseSearchType(final String type) {
157 if (type == null || type.isEmpty()) {
158 throw new IllegalArgumentException("Type provided was null or empty");
159 }
160
161 if (type.toLowerCase().equals("tsmeta")) {
162 return SearchType.TSMETA;
163 } else if (type.toLowerCase().equals("tsmeta_summary")) {
164 return SearchType.TSMETA_SUMMARY;
165 } else if (type.toLowerCase().equals("tsuids")) {
166 return SearchType.TSUIDS;
167 } else if (type.toLowerCase().equals("uidmeta")) {
168 return SearchType.UIDMETA;
169 } else if (type.toLowerCase().equals("annotation")) {
170 return SearchType.ANNOTATION;
171 } else if (type.toLowerCase().equals("lookup")) {
172 return SearchType.LOOKUP;
173 } else {
174 throw new IllegalArgumentException("Unknown type: " + type);
175 }
176 }
177
178 // GETTERS AND SETTERS --------------------------
179

Callers 10

parseSearchTypeTSMetaMethod · 0.95
parseSearchTypeTSUIDsMethod · 0.95
parseSearchTypeNullMethod · 0.95
parseSearchTypeEmtpyMethod · 0.95
deserializeMethod · 0.95
executeMethod · 0.95

Calls 2

isEmptyMethod · 0.80
equalsMethod · 0.45

Tested by 8

parseSearchTypeTSMetaMethod · 0.76
parseSearchTypeTSUIDsMethod · 0.76
parseSearchTypeNullMethod · 0.76
parseSearchTypeEmtpyMethod · 0.76