867ae1a451c118a50146266c9c2e484120693f3d
[externalapi/nbi.git] / src / main / java / org / onap / nbi / apis / serviceorder / model / ServiceRelationship.java
1 /**
2  *     Copyright (c) 2018 Orange
3  *
4  *     Licensed under the Apache License, Version 2.0 (the "License");
5  *     you may not use this file except in compliance with the License.
6  *     You may obtain a copy of the License at
7  *
8  *         http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *     Unless required by applicable law or agreed to in writing, software
11  *     distributed under the License is distributed on an "AS IS" BASIS,
12  *     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *     See the License for the specific language governing permissions and
14  *     limitations under the License.
15  */
16 /*
17  * API ServiceOrder serviceOrder API designed for ONAP Beijing Release. This API is build from TMF
18  * open API16.5 + applied TMF guideline 3.0
19  *
20  * OpenAPI spec version: 0.1.1_inProgress
21  * 
22  *
23  * NOTE: This class is auto generated by the swagger code generator program.
24  * https://github.com/swagger-api/swagger-codegen.git Do not edit the class manually.
25  *
26  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
27  * in compliance with the License. You may obtain a copy of the License at
28  *
29  * http://www.apache.org/licenses/LICENSE-2.0
30  *
31  * Unless required by applicable law or agreed to in writing, software distributed under the License
32  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
33  * or implied. See the License for the specific language governing permissions and limitations under
34  * the License.
35  */
36
37
38 package org.onap.nbi.apis.serviceorder.model;
39
40 import com.fasterxml.jackson.annotation.JsonProperty;
41 import io.swagger.annotations.ApiModel;
42 import io.swagger.annotations.ApiModelProperty;
43 import javax.validation.Valid;
44 import javax.validation.constraints.NotNull;
45 import java.util.Objects;
46
47 /**
48  * Linked Services to the one instantiate
49  */
50 @ApiModel(description = "Linked Services to the one instantiate")
51 @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen",
52         date = "2018-02-19T14:00:30.767Z")
53 public class ServiceRelationship {
54     @JsonProperty("type")
55     private RelationshipType type = null;
56
57     @JsonProperty("service")
58     private Service service = null;
59
60     public ServiceRelationship type(RelationshipType type) {
61         this.type = type;
62         return this;
63     }
64
65     /**
66      * Relationship type. It can be : “reliesOn” if the Service needs another already owned Service
67      * to rely on (e.g. an option on an already owned mobile access Service) or “targets” or
68      * “isTargeted” (depending on the way of expressing the link) for any other kind of links that
69      * may be useful
70      *
71      * @return type
72      **/
73     @JsonProperty("type")
74     @ApiModelProperty(required = true,
75             value = "Relationship type. It can be : “reliesOn” if the Service needs another already owned Service to rely on (e.g. an option on an already owned mobile access Service) or “targets” or “isTargeted” (depending on the way of expressing the link) for any other kind of links that may be useful")
76     @NotNull(message = "Relationship type cannot be null")
77     @Valid
78     public RelationshipType getType() {
79         return type;
80     }
81
82     public void setType(RelationshipType type) {
83         this.type = type;
84     }
85
86     public ServiceRelationship service(Service service) {
87         this.service = service;
88         return this;
89     }
90
91     /**
92      * Service reference
93      *
94      * @return service
95      **/
96     @JsonProperty("service")
97     @ApiModelProperty(required = true, value = "Service reference")
98     @NotNull(message = "Relationship service cannot be null")
99     @Valid
100     public Service getService() {
101         return service;
102     }
103
104     public void setService(Service service) {
105         this.service = service;
106     }
107
108
109     @Override
110     public boolean equals(java.lang.Object o) {
111         if (this == o) {
112             return true;
113         }
114         if (o == null || getClass() != o.getClass()) {
115             return false;
116         }
117         ServiceRelationship serviceRelationship = (ServiceRelationship) o;
118         return Objects.equals(this.type, serviceRelationship.type)
119                 && Objects.equals(this.service, serviceRelationship.service);
120     }
121
122     @Override
123     public int hashCode() {
124         return Objects.hash(type, service);
125     }
126
127
128     @Override
129     public String toString() {
130         StringBuilder sb = new StringBuilder();
131         sb.append("class ServiceRelationship {\n");
132
133         sb.append("    type: ").append(toIndentedString(type)).append("\n");
134         sb.append("    service: ").append(toIndentedString(service)).append("\n");
135         sb.append("}");
136         return sb.toString();
137     }
138
139     /**
140      * Convert the given object to string with each line indented by 4 spaces (except the first
141      * line).
142      */
143     private String toIndentedString(java.lang.Object o) {
144         if (o == null) {
145             return "null";
146         }
147         return o.toString().replace("\n", "\n    ");
148     }
149 }
150