Merge "Fix rollback for ConfigAssignBB"
[so.git] / common / src / main / java / org / onap / so / client / aai / entities / uri / AAISimpleUri.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 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.so.client.aai.entities.uri;
22
23 import java.net.URI;
24 import java.util.regex.Pattern;
25 import javax.ws.rs.core.UriBuilder;
26 import org.onap.so.client.aai.AAIObjectPlurals;
27 import org.onap.so.client.aai.AAIObjectType;
28 import org.onap.so.client.graphinventory.Format;
29 import org.onap.so.client.graphinventory.entities.uri.Depth;
30 import org.onap.so.client.graphinventory.entities.uri.SimpleUri;
31
32 public class AAISimpleUri extends SimpleUri implements AAIResourceUri {
33
34     private static final long serialVersionUID = -6397024057188453229L;
35
36     protected AAISimpleUri(AAIObjectType type, Object... values) {
37         super(type, values);
38
39     }
40
41     protected AAISimpleUri(AAIObjectType type, URI uri) {
42         super(type, uri);
43     }
44
45     protected AAISimpleUri(AAIObjectType type, UriBuilder builder, Object... values) {
46         super(type, builder, values);
47     }
48
49     protected AAISimpleUri(AAIObjectPlurals type, UriBuilder builder, Object... values) {
50         super(type, builder, values);
51     }
52
53     protected AAISimpleUri(AAIObjectPlurals type) {
54         super(type);
55     }
56
57     protected AAISimpleUri(AAIObjectPlurals type, Object... values) {
58         super(type, values);
59     }
60
61     protected AAISimpleUri(AAIResourceUri parentUri, AAIObjectType childType, Object... childValues) {
62         super(parentUri, childType, childValues);
63     }
64
65     protected AAISimpleUri(AAIResourceUri parentUri, AAIObjectPlurals childType) {
66         super(parentUri, childType);
67     }
68
69     @Override
70     public AAISimpleUri relationshipAPI() {
71         return (AAISimpleUri) super.relationshipAPI();
72     }
73
74     @Override
75     public AAISimpleUri relatedTo(AAIObjectPlurals plural) {
76         return (AAISimpleUri) super.relatedTo(plural);
77     }
78
79     @Override
80     public AAISimpleUri relatedTo(AAIObjectType type, String... values) {
81         return (AAISimpleUri) super.relatedTo(type, values);
82     }
83
84     @Override
85     public AAISimpleUri resourceVersion(String version) {
86         return (AAISimpleUri) super.resourceVersion(version);
87     }
88
89     @Override
90     public AAISimpleUri queryParam(String name, String... values) {
91         return (AAISimpleUri) super.queryParam(name, values);
92     }
93
94     @Override
95     public AAISimpleUri replaceQueryParam(String name, String... values) {
96         return (AAISimpleUri) super.replaceQueryParam(name, values);
97     }
98
99     @Override
100     public AAISimpleUri resultIndex(int index) {
101         return (AAISimpleUri) super.resultIndex(index);
102     }
103
104     @Override
105     public AAISimpleUri resultSize(int size) {
106         return (AAISimpleUri) super.resultSize(size);
107     }
108
109     @Override
110     public AAISimpleUri limit(int size) {
111         return (AAISimpleUri) super.limit(size);
112     }
113
114     @Override
115     public AAISimpleUri clone() {
116         if (this.type != null) {
117             return new AAISimpleUri((AAIObjectType) this.type, this.internalURI.clone(), values);
118         } else {
119             return new AAISimpleUri((AAIObjectPlurals) this.pluralType, this.internalURI.clone(), values);
120         }
121     }
122
123     @Override
124     public AAIObjectType getObjectType() {
125         return (AAIObjectType) this.type;
126     }
127
128     @Override
129     public AAISimpleUri depth(Depth depth) {
130         return (AAISimpleUri) super.depth(depth);
131     }
132
133     @Override
134     public AAISimpleUri nodesOnly(boolean nodesOnly) {
135         return (AAISimpleUri) super.nodesOnly(nodesOnly);
136     }
137
138     @Override
139     public AAISimpleUri format(Format format) {
140         return (AAISimpleUri) super.format(format);
141     }
142
143     @Override
144     protected Pattern getPrefixPattern() {
145         return Pattern.compile("/aai/v\\d+");
146     }
147 }