forked from aws/aws-sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConnectionCost.java
More file actions
242 lines (211 loc) · 7.63 KB
/
ConnectionCost.java
File metadata and controls
242 lines (211 loc) · 7.63 KB
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
/*
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. 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.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.
*/
package com.amazonaws.services.directconnect.model;
import java.io.Serializable;
/**
* <p>
* Cost description.
* </p>
*/
public class ConnectionCost implements Serializable {
/**
* The name of the cost item. <p>Example: Inbound data transfer
*/
private String name;
/**
* The unit used in cost calculation. <p>Example: "Gbps," if the price is
* calculated based on Gbps.
*/
private String unit;
/**
* Currency code based on ISO 4217. <p>Example: "USD" for US dollar.
*/
private String currencyCode;
/**
* The amount of charge per unit. <p>Example: 0.01
*/
private String amount;
/**
* The name of the cost item. <p>Example: Inbound data transfer
*
* @return The name of the cost item. <p>Example: Inbound data transfer
*/
public String getName() {
return name;
}
/**
* The name of the cost item. <p>Example: Inbound data transfer
*
* @param name The name of the cost item. <p>Example: Inbound data transfer
*/
public void setName(String name) {
this.name = name;
}
/**
* The name of the cost item. <p>Example: Inbound data transfer
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param name The name of the cost item. <p>Example: Inbound data transfer
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ConnectionCost withName(String name) {
this.name = name;
return this;
}
/**
* The unit used in cost calculation. <p>Example: "Gbps," if the price is
* calculated based on Gbps.
*
* @return The unit used in cost calculation. <p>Example: "Gbps," if the price is
* calculated based on Gbps.
*/
public String getUnit() {
return unit;
}
/**
* The unit used in cost calculation. <p>Example: "Gbps," if the price is
* calculated based on Gbps.
*
* @param unit The unit used in cost calculation. <p>Example: "Gbps," if the price is
* calculated based on Gbps.
*/
public void setUnit(String unit) {
this.unit = unit;
}
/**
* The unit used in cost calculation. <p>Example: "Gbps," if the price is
* calculated based on Gbps.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param unit The unit used in cost calculation. <p>Example: "Gbps," if the price is
* calculated based on Gbps.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ConnectionCost withUnit(String unit) {
this.unit = unit;
return this;
}
/**
* Currency code based on ISO 4217. <p>Example: "USD" for US dollar.
*
* @return Currency code based on ISO 4217. <p>Example: "USD" for US dollar.
*/
public String getCurrencyCode() {
return currencyCode;
}
/**
* Currency code based on ISO 4217. <p>Example: "USD" for US dollar.
*
* @param currencyCode Currency code based on ISO 4217. <p>Example: "USD" for US dollar.
*/
public void setCurrencyCode(String currencyCode) {
this.currencyCode = currencyCode;
}
/**
* Currency code based on ISO 4217. <p>Example: "USD" for US dollar.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param currencyCode Currency code based on ISO 4217. <p>Example: "USD" for US dollar.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ConnectionCost withCurrencyCode(String currencyCode) {
this.currencyCode = currencyCode;
return this;
}
/**
* The amount of charge per unit. <p>Example: 0.01
*
* @return The amount of charge per unit. <p>Example: 0.01
*/
public String getAmount() {
return amount;
}
/**
* The amount of charge per unit. <p>Example: 0.01
*
* @param amount The amount of charge per unit. <p>Example: 0.01
*/
public void setAmount(String amount) {
this.amount = amount;
}
/**
* The amount of charge per unit. <p>Example: 0.01
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param amount The amount of charge per unit. <p>Example: 0.01
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ConnectionCost withAmount(String amount) {
this.amount = amount;
return this;
}
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getName() != null) sb.append("Name: " + getName() + ",");
if (getUnit() != null) sb.append("Unit: " + getUnit() + ",");
if (getCurrencyCode() != null) sb.append("CurrencyCode: " + getCurrencyCode() + ",");
if (getAmount() != null) sb.append("Amount: " + getAmount() );
sb.append("}");
return sb.toString();
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getUnit() == null) ? 0 : getUnit().hashCode());
hashCode = prime * hashCode + ((getCurrencyCode() == null) ? 0 : getCurrencyCode().hashCode());
hashCode = prime * hashCode + ((getAmount() == null) ? 0 : getAmount().hashCode());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null) return false;
if (obj instanceof ConnectionCost == false) return false;
ConnectionCost other = (ConnectionCost)obj;
if (other.getName() == null ^ this.getName() == null) return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false) return false;
if (other.getUnit() == null ^ this.getUnit() == null) return false;
if (other.getUnit() != null && other.getUnit().equals(this.getUnit()) == false) return false;
if (other.getCurrencyCode() == null ^ this.getCurrencyCode() == null) return false;
if (other.getCurrencyCode() != null && other.getCurrencyCode().equals(this.getCurrencyCode()) == false) return false;
if (other.getAmount() == null ^ this.getAmount() == null) return false;
if (other.getAmount() != null && other.getAmount().equals(this.getAmount()) == false) return false;
return true;
}
}