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
33 public static final String VERSION_EXPRESSION = "v8|v9|v10|v11|v12|v13|latest";
34 public static final String VERSION_EXPRESSION_V8_PLUS = "v8|v9|v10|v11|v12|v13|latest";
35 public static final String VERSION_EXPRESSION_V9_PLUS = "v9|v10|v11|v12|v13|latest";
38 * Checks if v is the latest version
42 public static boolean isLatest(Version v) {
43 return Version.getLatest().equals(v);
47 * Gets the latest version
50 public static Version getLatest(){
51 return Version.values()[Version.values().length-1];
55 * To be used inplace of <b>Version.getVersion(String)</b> to correctly get version of "latest"
59 public static Version getVersion(String v) {
60 if ("latest".equals(v)) {
61 return Version.getLatest();
63 return Version.valueOf(v);