2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
20 package org.onap.aai.introspection;
23 * Requires the order to be in ascending order
34 public static final String VERSION_EXPRESSION = "v8|v9|v10|v11|v12|v13|v14|latest";
35 public static final String VERSION_EXPRESSION_V8_PLUS = "v8|v9|v10|v11|v12|v13|v14|latest";
36 public static final String VERSION_EXPRESSION_V9_PLUS = "v9|v10|v11|v12|v13|v14|latest";
39 * Checks if v is the latest version
43 public static boolean isLatest(Version v) {
44 return Version.getLatest().equals(v);
48 * Gets the latest version
51 public static Version getLatest(){
52 return Version.values()[Version.values().length-1];
56 * To be used inplace of <b>Version.getVersion(String)</b> to correctly get version of "latest"
60 public static Version getVersion(String v) {
61 if ("latest".equals(v)) {
62 return Version.getLatest();
64 return Version.valueOf(v);