2 * ============LICENSE_START=======================================================
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
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=========================================================
21 package org.onap.aaiclient.client.aai.entities.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;
29 public class AAISimpleUri extends
30 SimpleUri<AAIResourceUri, AAIPluralResourceUri, AAIObjectType, AAIObjectPlurals, AAISingleFragment, AAIPluralFragment>
31 implements AAIResourceUri {
33 private static final long serialVersionUID = -6397024057188453229L;
35 protected AAISimpleUri(AAIObjectType type, Object... values) {
40 protected AAISimpleUri(AAIObjectType type, URI uri) {
44 protected AAISimpleUri(AAIObjectType type, UriBuilder builder, Object... values) {
45 super(type, builder, values);
48 protected AAISimpleUri(AAIResourceUri parentUri, AAIObjectType childType, Object... childValues) {
49 super(parentUri, childType, childValues);
53 protected AAISimpleUri(AAISimpleUri copy) {
58 public AAISimpleUri clone() {
59 return new AAISimpleUri(this);
63 public AAISimpleUri relatedTo(AAIObjectType type, String... values) {
64 this.internalURI = internalURI.path(relatedTo);
65 return new AAISimpleUri(this, type, values);
69 public AAISimplePluralUri relatedTo(AAIObjectPlurals plural) {
70 this.internalURI.path(relatedTo);
71 return new AAISimplePluralUri(this, plural);
75 public AAISimpleUri relatedTo(AAISingleFragment fragment) {
76 this.internalURI.path(relatedTo);
77 return new AAISimpleUri(this, fragment.get().build(), fragment.get().values());
81 public AAISimplePluralUri relatedTo(AAIPluralFragment fragment) {
82 this.internalURI.path(relatedTo);
83 return new AAISimplePluralUri(this, fragment.get().build());