6594f23226a810db413c059f068675aa3673f663
[aai/aai-common.git] / aai-schema-ingest / src / main / java / org / onap / aai / setup / SchemaServiceVersions.java
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
4  * ================================================================================
5  * Copyright © 2017-18 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 package org.onap.aai.setup;
21
22 import javax.annotation.PostConstruct;
23 import java.util.List;
24 import java.util.stream.Collectors;
25
26 public class SchemaServiceVersions extends SchemaVersions {
27     private List<String> versions;
28     private String edgeVersion;
29     private String defaultVersion;
30     private String depthVersion;
31     private String appRootVersion;
32     private String relatedLinkVersion;
33     private String namespaceChangeVersion;
34
35
36     @PostConstruct
37     public void initializeFromSchemaService() {
38         versionsValue = versions.stream().map(SchemaVersion::new).collect(Collectors.toList());
39         edgeLabelVersionValue = new SchemaVersion(edgeVersion);
40         defaultVersionValue = new SchemaVersion(defaultVersion);
41         depthVersionValue = new SchemaVersion(depthVersion);
42         appRootVersionValue = new SchemaVersion(appRootVersion);
43         relatedLinkVersionValue = new SchemaVersion(relatedLinkVersion);
44         namespaceChangeVersionValue = new SchemaVersion(namespaceChangeVersion);
45         this.validate();
46     }
47
48 }