2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 - 2019 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.vid.aai.model.AaiGetNetworkCollectionDetails;
23 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
24 import com.fasterxml.jackson.annotation.JsonProperty;
25 import org.apache.commons.lang3.ObjectUtils;
27 import java.util.List;
29 import static java.util.Collections.emptyList;
31 @JsonIgnoreProperties(ignoreUnknown = true)
32 public class CloudRegion {
34 private final String cloudOwner;
35 private final String cloudRegionId;
38 @JsonProperty("cloud-owner") String cloudOwner,
39 @JsonProperty("cloud-region-id") String cloudRegionId
41 this.cloudOwner = cloudOwner;
42 this.cloudRegionId = cloudRegionId;
45 public String getCloudOwner() {
49 public String getCloudRegionId() {
54 This will handle container like:
57 "cloud-owner": "alfi",
58 "cloud-region-id": "foo",
61 "cloud-owner": "alba",
62 "cloud-region-id": "bar",
64 public static class Collection {
65 private final List<CloudRegion> cloudRegions;
67 public Collection(@JsonProperty("cloud-region") List<CloudRegion> cloudRegions) {
68 this.cloudRegions = ObjectUtils.defaultIfNull(cloudRegions, emptyList());
71 public List<CloudRegion> getCloudRegions() {