40184b028be269dd0889ea1a42af6bf80cacab83
[so.git] /
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.aaiclient.client.aai.entities.uri;
22
23 import java.net.URI;
24 import javax.ws.rs.core.UriBuilder;
25 import org.onap.aaiclient.client.aai.AAIObjectPlurals;
26 import org.onap.aaiclient.client.aai.AAIObjectType;
27 import org.onap.aaiclient.client.graphinventory.entities.uri.SimpleUri;
28
29 public class AAISimpleUri extends SimpleUri<AAIResourceUri, AAIPluralResourceUri, AAIObjectType, AAIObjectPlurals>
30         implements AAIResourceUri {
31
32     private static final long serialVersionUID = -6397024057188453229L;
33
34     protected AAISimpleUri(AAIObjectType type, Object... values) {
35         super(type, values);
36
37     }
38
39     protected AAISimpleUri(AAIObjectType type, URI uri) {
40         super(type, uri);
41     }
42
43     protected AAISimpleUri(AAIObjectType type, UriBuilder builder, Object... values) {
44         super(type, builder, values);
45     }
46
47     protected AAISimpleUri(AAIResourceUri parentUri, AAIObjectType childType, Object... childValues) {
48         super(parentUri, childType, childValues);
49     }
50
51     // copy constructor
52     protected AAISimpleUri(AAISimpleUri copy) {
53         super(copy);
54     }
55
56     @Override
57     public AAISimpleUri clone() {
58         return new AAISimpleUri(this);
59     }
60
61     @Override
62     public AAISimpleUri relatedTo(AAIObjectType type, String... values) {
63         this.internalURI = internalURI.path(relatedTo);
64         return new AAISimpleUri(this, type, values);
65     }
66
67     @Override
68     public AAISimplePluralUri relatedTo(AAIObjectPlurals plural) {
69         this.internalURI.path(relatedTo);
70         return new AAISimplePluralUri(this, plural);
71     }
72
73 }