Add instructions to invoke the linter and code formatter plugins to the README and...
[aai/schema-service.git] / aai-schema-service / src / main / java / org / onap / aai / schemaservice / versions / VersionService.java
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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=========================================================
19  */
20
21 package org.onap.aai.schemaservice.versions;
22
23 import java.util.List;
24
25 import org.springframework.beans.factory.annotation.Value;
26 import org.springframework.stereotype.Service;
27
28 @Service
29 public class VersionService {
30
31     @Value("#{'${schema.version.list}'.split(',')}")
32     private List<String> schemaVersionList;
33
34     @Value("${schema.version.depth.start}")
35     private String depthStart;
36
37     @Value("${schema.version.related.link.start}")
38     private String relatedLinkStart;
39
40     @Value("${schema.version.app.root.start}")
41     private String appRootStart;
42
43     @Value("${schema.version.namespace.change.start}")
44     private String namespaceChangeStart;
45
46     @Value("${schema.version.edge.label.start}")
47     private String edgeLabelStart;
48
49     @Value("${schema.version.api.default}")
50     private String defaultApi;
51
52     public Version getVersionInfo() {
53
54         Version schemaVersion = new Version();
55         schemaVersion.setVersions(schemaVersionList);
56         schemaVersion.setDepthVersion(depthStart);
57         schemaVersion.setRelatedLinkVersion(relatedLinkStart);
58         schemaVersion.setAppRootVersion(appRootStart);
59         schemaVersion.setNamespaceChangeVersion(namespaceChangeStart);
60         schemaVersion.setEdgeVersion(edgeLabelStart);
61         schemaVersion.setDefaultVersion(defaultApi);
62
63         return schemaVersion;
64     }
65 }