aboutsummaryrefslogtreecommitdiffstats
path: root/common/src/main/java/org/onap/so/client/aai/entities/uri/AAISimpleUri.java
blob: 1fe9da984ff7301406716805a2b4cc713a0a233f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/*-
 * ============LICENSE_START=======================================================
 * ONAP - SO
 * ================================================================================
 * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
 * ================================================================================
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============LICENSE_END=========================================================
 */

package org.onap.so.client.aai.entities.uri;

import java.net.URI;
import java.util.regex.Pattern;
import javax.ws.rs.core.UriBuilder;
import org.onap.so.client.aai.AAIObjectPlurals;
import org.onap.so.client.aai.AAIObjectType;
import org.onap.so.client.graphinventory.Format;
import org.onap.so.client.graphinventory.entities.uri.Depth;
import org.onap.so.client.graphinventory.entities.uri.SimpleUri;

public class AAISimpleUri extends SimpleUri implements AAIResourceUri {

    private static final long serialVersionUID = -6397024057188453229L;

    protected AAISimpleUri(AAIObjectType type, Object... values) {
        super(type, values);

    }

    protected AAISimpleUri(AAIObjectType type, URI uri) {
        super(type, uri);
    }

    protected AAISimpleUri(AAIObjectType type, UriBuilder builder, Object... values) {
        super(type, builder, values);
    }

    protected AAISimpleUri(AAIObjectPlurals type, UriBuilder builder, Object... values) {
        super(type, builder, values);
    }

    protected AAISimpleUri(AAIObjectPlurals type) {
        super(type);
    }

    protected AAISimpleUri(AAIObjectPlurals type, Object... values) {
        super(type, values);
    }

    protected AAISimpleUri(AAIResourceUri parentUri, AAIObjectType childType, Object... childValues) {
        super(parentUri, childType, childValues);
    }

    protected AAISimpleUri(AAIResourceUri parentUri, AAIObjectPlurals childType) {
        super(parentUri, childType);
    }

    @Override
    public AAISimpleUri relationshipAPI() {
        return (AAISimpleUri) super.relationshipAPI();
    }

    @Override
    public AAISimpleUri relatedTo(AAIObjectPlurals plural) {
        return (AAISimpleUri) super.relatedTo(plural);
    }

    @Override
    public AAISimpleUri relatedTo(AAIObjectType type, String... values) {
        return (AAISimpleUri) super.relatedTo(type, values);
    }

    @Override
    public AAISimpleUri resourceVersion(String version) {
        return (AAISimpleUri) super.resourceVersion(version);
    }

    @Override
    public AAISimpleUri queryParam(String name, String... values) {
        return (AAISimpleUri) super.queryParam(name, values);
    }

    @Override
    public AAISimpleUri replaceQueryParam(String name, String... values) {
        return (AAISimpleUri) super.replaceQueryParam(name, values);
    }

    @Override
    public AAISimpleUri resultIndex(int index) {
        return (AAISimpleUri) super.resultIndex(index);
    }

    @Override
    public AAISimpleUri resultSize(int size) {
        return (AAISimpleUri) super.resultSize(size);
    }

    @Override
    public AAISimpleUri limit(int size) {
        return (AAISimpleUri) super.limit(size);
    }

    @Override
    public AAISimpleUri clone() {
        if (this.type != null) {
            return new AAISimpleUri((AAIObjectType) this.type, this.internalURI.clone(), values);
        } else {
            return new AAISimpleUri((AAIObjectPlurals) this.pluralType, this.internalURI.clone(), values);
        }
    }

    @Override
    public AAIObjectType getObjectType() {
        return (AAIObjectType) this.type;
    }

    @Override
    public AAISimpleUri depth(Depth depth) {
        return (AAISimpleUri) super.depth(depth);
    }

    @Override
    public AAISimpleUri nodesOnly(boolean nodesOnly) {
        return (AAISimpleUri) super.nodesOnly(nodesOnly);
    }

    @Override
    public AAISimpleUri format(Format format) {
        return (AAISimpleUri) super.format(format);
    }

    @Override
    protected Pattern getPrefixPattern() {
        return Pattern.compile("/aai/v\\d+");
    }
}