| 1 | /** |
| 2 | * Licensed to jclouds, Inc. (jclouds) under one or more |
| 3 | * contributor license agreements. See the NOTICE file |
| 4 | * distributed with this work for additional information |
| 5 | * regarding copyright ownership. jclouds licenses this file |
| 6 | * to you under the Apache License, Version 2.0 (the |
| 7 | * "License"); you may not use this file except in compliance |
| 8 | * with the License. You may obtain a copy of the License at |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 12 | * Unless required by applicable law or agreed to in writing, |
| 13 | * software distributed under the License is distributed on an |
| 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | * KIND, either express or implied. See the License for the |
| 16 | * specific language governing permissions and limitations |
| 17 | * under the License. |
| 18 | */ |
| 19 | package org.jclouds.softlayer.domain; |
| 20 | |
| 21 | import com.google.common.base.CaseFormat; |
| 22 | import com.google.gson.annotations.SerializedName; |
| 23 | |
| 24 | import java.util.Date; |
| 25 | |
| 26 | import static com.google.common.base.Preconditions.checkNotNull; |
| 27 | |
| 28 | /** |
| 29 | * The virtual guest data type presents the structure in which all virtual guests will be presented. |
| 30 | * Internally, the structure supports various virtualization platforms with no change to external |
| 31 | * interaction. <br/> |
| 32 | * A guest, also known as a virtual server or CloudLayer Computing Instance, represents an |
| 33 | * allocation of resources on a virtual host. |
| 34 | * |
| 35 | * The hostname and domain must be alphanumeric strings that may be separated by periods '.'. |
| 36 | * The only other allowable special character is the dash '-'. |
| 37 | * However the special characters '.' and '-' may not be consecutive. |
| 38 | * Each alphanumeric string separated by a period is considered a label. |
| 39 | * Labels must begin and end with an alphanumeric character. |
| 40 | * Each label cannot be soley comprised of digits and must be between 1-63 characters in length. |
| 41 | * The last label, the TLD (top level domain) must be between 2-6 alphabetic characters. |
| 42 | * The domain portion must consist of least one label followed by a period '.' then ending with the TLD label. |
| 43 | * Combining the hostname, followed by a period '.', followed by the domain gives the FQDN (fully qualified domain name), |
| 44 | * which may not exceed 253 characters in total length. |
| 45 | * |
| 46 | * @author Adrian Cole |
| 47 | * @see <a href= |
| 48 | * "http://sldn.softlayer.com/reference/datatypes/SoftLayer_Virtual_Guest" |
| 49 | * /> |
| 50 | */ |
| 51 | public class VirtualGuest implements Comparable<VirtualGuest> { |
| 52 | public static Builder builder() { |
| 53 | return new Builder(); |
| 54 | } |
| 55 | |
| 56 | public static class Builder { |
| 57 | private int id = -1; |
| 58 | private int accountId = -1; |
| 59 | private Date createDate; |
| 60 | private boolean dedicatedAccountHostOnly; |
| 61 | private String hostname; |
| 62 | private String domain; |
| 63 | private String fullyQualifiedDomainName; |
| 64 | private Date lastVerifiedDate; |
| 65 | private int maxCpu = -1; |
| 66 | private String maxCpuUnits; |
| 67 | private int maxMemory = -1; |
| 68 | private Date metricPollDate; |
| 69 | private Date modifyDate; |
| 70 | private String notes; |
| 71 | private boolean privateNetworkOnly; |
| 72 | private int startCpus = -1; |
| 73 | private int statusId = -1; |
| 74 | private String uuid; |
| 75 | private String primaryBackendIpAddress; |
| 76 | private String primaryIpAddress; |
| 77 | private int billingItemId; |
| 78 | private OperatingSystem operatingSystem; |
| 79 | private Datacenter datacenter; |
| 80 | private PowerState powerState; |
| 81 | |
| 82 | public Builder id(int id) { |
| 83 | this.id = id; |
| 84 | return this; |
| 85 | } |
| 86 | |
| 87 | public Builder accountId(int accountId) { |
| 88 | this.accountId = accountId; |
| 89 | return this; |
| 90 | } |
| 91 | |
| 92 | public Builder createDate(Date createDate) { |
| 93 | this.createDate = createDate; |
| 94 | return this; |
| 95 | } |
| 96 | |
| 97 | public Builder dedicatedAccountHostOnly(boolean dedicatedAccountHostOnly) { |
| 98 | this.dedicatedAccountHostOnly = dedicatedAccountHostOnly; |
| 99 | return this; |
| 100 | } |
| 101 | |
| 102 | public Builder hostname(String hostname) { |
| 103 | this.hostname = hostname; |
| 104 | return this; |
| 105 | } |
| 106 | |
| 107 | public Builder domain(String domain) { |
| 108 | this.domain = domain; |
| 109 | return this; |
| 110 | } |
| 111 | |
| 112 | public Builder fullyQualifiedDomainName(String fullyQualifiedDomainName) { |
| 113 | this.fullyQualifiedDomainName = fullyQualifiedDomainName; |
| 114 | return this; |
| 115 | } |
| 116 | |
| 117 | public Builder lastVerifiedDate(Date lastVerifiedDate) { |
| 118 | this.lastVerifiedDate = lastVerifiedDate; |
| 119 | return this; |
| 120 | } |
| 121 | |
| 122 | public Builder maxCpu(int maxCpu) { |
| 123 | this.maxCpu = maxCpu; |
| 124 | return this; |
| 125 | } |
| 126 | |
| 127 | public Builder maxCpuUnits(String maxCpuUnits) { |
| 128 | this.maxCpuUnits = maxCpuUnits; |
| 129 | return this; |
| 130 | } |
| 131 | |
| 132 | public Builder maxMemory(int maxMemory) { |
| 133 | this.maxMemory = maxMemory; |
| 134 | return this; |
| 135 | } |
| 136 | |
| 137 | public Builder metricPollDate(Date metricPollDate) { |
| 138 | this.metricPollDate = metricPollDate; |
| 139 | return this; |
| 140 | } |
| 141 | |
| 142 | public Builder modifyDate(Date modifyDate) { |
| 143 | this.modifyDate = modifyDate; |
| 144 | return this; |
| 145 | } |
| 146 | |
| 147 | public Builder notes(String notes) { |
| 148 | this.notes = notes; |
| 149 | return this; |
| 150 | } |
| 151 | |
| 152 | public Builder privateNetworkOnly(boolean privateNetworkOnly) { |
| 153 | this.privateNetworkOnly = privateNetworkOnly; |
| 154 | return this; |
| 155 | } |
| 156 | |
| 157 | public Builder startCpus(int startCpus) { |
| 158 | this.startCpus = startCpus; |
| 159 | return this; |
| 160 | } |
| 161 | |
| 162 | public Builder statusId(int statusId) { |
| 163 | this.statusId = statusId; |
| 164 | return this; |
| 165 | } |
| 166 | |
| 167 | public Builder uuid(String uuid) { |
| 168 | this.uuid = uuid; |
| 169 | return this; |
| 170 | } |
| 171 | |
| 172 | public Builder primaryBackendIpAddress(String primaryBackendIpAddress) { |
| 173 | this.primaryBackendIpAddress = primaryBackendIpAddress; |
| 174 | return this; |
| 175 | } |
| 176 | |
| 177 | public Builder primaryIpAddress(String primaryIpAddress) { |
| 178 | this.primaryIpAddress = primaryIpAddress; |
| 179 | return this; |
| 180 | } |
| 181 | |
| 182 | public Builder billingItemId(int billingItemId) { |
| 183 | this.billingItemId = billingItemId; |
| 184 | return this; |
| 185 | } |
| 186 | |
| 187 | public Builder operatingSystem(OperatingSystem operatingSystem) { |
| 188 | this.operatingSystem = operatingSystem; |
| 189 | return this; |
| 190 | } |
| 191 | |
| 192 | public Builder datacenter(Datacenter datacenter) { |
| 193 | this.datacenter = datacenter; |
| 194 | return this; |
| 195 | } |
| 196 | |
| 197 | public Builder powerState(PowerState powerState) { |
| 198 | this.powerState = powerState; |
| 199 | return this; |
| 200 | } |
| 201 | |
| 202 | public VirtualGuest build() { |
| 203 | return new VirtualGuest(accountId, createDate, dedicatedAccountHostOnly, domain, |
| 204 | fullyQualifiedDomainName, hostname, id, lastVerifiedDate, maxCpu, |
| 205 | maxCpuUnits, maxMemory, metricPollDate, modifyDate, notes, |
| 206 | privateNetworkOnly, startCpus, statusId, uuid, primaryBackendIpAddress, |
| 207 | primaryIpAddress, billingItemId,operatingSystem,datacenter,powerState); |
| 208 | } |
| 209 | |
| 210 | public static Builder fromVirtualGuest(VirtualGuest in) { |
| 211 | return VirtualGuest.builder() |
| 212 | .accountId(in.getAccountId()) |
| 213 | .createDate(in.getCreateDate()) |
| 214 | .dedicatedAccountHostOnly(in.isDedicatedAccountHostOnly()) |
| 215 | .domain(in.getDomain()) |
| 216 | .fullyQualifiedDomainName(in.getFullyQualifiedDomainName()) |
| 217 | .hostname(in.getHostname()) |
| 218 | .id(in.getId()) |
| 219 | .lastVerifiedDate(in.getLastVerifiedDate()) |
| 220 | .maxCpu(in.getMaxCpu()) |
| 221 | .maxCpuUnits(in.getMaxCpuUnits()) |
| 222 | .maxMemory(in.getMaxMemory()) |
| 223 | .metricPollDate(in.getMetricPollDate()) |
| 224 | .modifyDate(in.getModifyDate()) |
| 225 | .notes(in.getNotes()) |
| 226 | .privateNetworkOnly(in.isPrivateNetworkOnly()) |
| 227 | .startCpus(in.getStartCpus()) |
| 228 | .statusId(in.getStatusId()) |
| 229 | .uuid(in.getUuid()) |
| 230 | .primaryBackendIpAddress(in.getPrimaryBackendIpAddress()) |
| 231 | .primaryIpAddress(in.getPrimaryIpAddress()) |
| 232 | .billingItemId(in.getBillingItemId()) |
| 233 | .operatingSystem(in.getOperatingSystem()) |
| 234 | .datacenter(in.getDatacenter()) |
| 235 | .powerState(in.getPowerState()); |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | /** |
| 240 | * These states come from the powerState field. i.e. |
| 241 | * https://api.softlayer.com/rest/v3/SoftLayer_Account/getVirtualGuests/{id}?objectMask=powerState |
| 242 | */ |
| 243 | public static enum State { |
| 244 | HALTED, |
| 245 | PAUSED, |
| 246 | RUNNING, |
| 247 | UNRECOGNIZED; |
| 248 | |
| 249 | @Override |
| 250 | public String toString() { |
| 251 | return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, name()); |
| 252 | } |
| 253 | |
| 254 | public static State fromValue(String state) { |
| 255 | try { |
| 256 | return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(state, "state"))); |
| 257 | } catch (IllegalArgumentException e) { |
| 258 | return UNRECOGNIZED; |
| 259 | } |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | private int accountId = -1; |
| 264 | private Date createDate; |
| 265 | @SerializedName("dedicatedAccountHostOnlyFlag") |
| 266 | private boolean dedicatedAccountHostOnly; |
| 267 | private String domain; |
| 268 | private String fullyQualifiedDomainName; |
| 269 | private String hostname; |
| 270 | private int id = -1; |
| 271 | private Date lastVerifiedDate; |
| 272 | private int maxCpu = -1; |
| 273 | private String maxCpuUnits; |
| 274 | private int maxMemory = -1; |
| 275 | private Date metricPollDate; |
| 276 | private Date modifyDate; |
| 277 | private String notes; |
| 278 | @SerializedName("privateNetworkOnlyFlag") |
| 279 | private boolean privateNetworkOnly; |
| 280 | private int startCpus = -1; |
| 281 | private int statusId = -1; |
| 282 | private String uuid; |
| 283 | private String primaryBackendIpAddress; |
| 284 | private String primaryIpAddress; |
| 285 | |
| 286 | private int billingItemId = -1; |
| 287 | private OperatingSystem operatingSystem; |
| 288 | private Datacenter datacenter; |
| 289 | private PowerState powerState; |
| 290 | |
| 291 | // for deserializer |
| 292 | VirtualGuest() { |
| 293 | |
| 294 | } |
| 295 | |
| 296 | public VirtualGuest(int accountId, Date createDate, boolean dedicatedAccountHostOnly, String domain, |
| 297 | String fullyQualifiedDomainName, String hostname, int id, Date lastVerifiedDate, int maxCpu, |
| 298 | String maxCpuUnits, int maxMemory, Date metricPollDate, Date modifyDate, String notes, |
| 299 | boolean privateNetworkOnly, int startCpus, int statusId, String uuid, String primaryBackendIpAddress, |
| 300 | String primaryIpAddress,int billingItemId, OperatingSystem operatingSystem, Datacenter datacenter, PowerState powerState) { |
| 301 | this.accountId = accountId; |
| 302 | this.createDate = createDate; |
| 303 | this.dedicatedAccountHostOnly = dedicatedAccountHostOnly; |
| 304 | this.domain = domain; |
| 305 | this.fullyQualifiedDomainName = fullyQualifiedDomainName; |
| 306 | this.hostname = hostname; |
| 307 | this.id = id; |
| 308 | this.lastVerifiedDate = lastVerifiedDate; |
| 309 | this.maxCpu = maxCpu; |
| 310 | this.maxCpuUnits = maxCpuUnits; |
| 311 | this.maxMemory = maxMemory; |
| 312 | this.metricPollDate = metricPollDate; |
| 313 | this.modifyDate = modifyDate; |
| 314 | this.notes = notes; |
| 315 | this.privateNetworkOnly = privateNetworkOnly; |
| 316 | this.startCpus = startCpus; |
| 317 | this.statusId = statusId; |
| 318 | this.uuid = uuid; |
| 319 | this.primaryBackendIpAddress = primaryBackendIpAddress; |
| 320 | this.primaryIpAddress = primaryIpAddress; |
| 321 | this.billingItemId = billingItemId; |
| 322 | this.operatingSystem = operatingSystem; |
| 323 | this.datacenter = datacenter; |
| 324 | this.powerState = powerState; |
| 325 | } |
| 326 | |
| 327 | @Override |
| 328 | public int compareTo(VirtualGuest arg0) { |
| 329 | return new Integer(id).compareTo(arg0.getId()); |
| 330 | } |
| 331 | |
| 332 | /** |
| 333 | * @return A computing instance's associated account id |
| 334 | */ |
| 335 | public int getAccountId() { |
| 336 | return accountId; |
| 337 | } |
| 338 | |
| 339 | /** |
| 340 | * @return The date a virtual computing instance was created. |
| 341 | */ |
| 342 | public Date getCreateDate() { |
| 343 | return createDate; |
| 344 | } |
| 345 | |
| 346 | /** |
| 347 | * @return When true this flag specifies that a compute instance is to run on hosts that only |
| 348 | * have guests from the same account. |
| 349 | */ |
| 350 | public boolean isDedicatedAccountHostOnly() { |
| 351 | return dedicatedAccountHostOnly; |
| 352 | } |
| 353 | |
| 354 | /** |
| 355 | * @return A computing instance's domain name |
| 356 | */ |
| 357 | public String getDomain() { |
| 358 | return domain; |
| 359 | } |
| 360 | |
| 361 | /** |
| 362 | * @return A name reflecting the hostname and domain of the computing instance. |
| 363 | */ |
| 364 | public String getFullyQualifiedDomainName() { |
| 365 | return fullyQualifiedDomainName; |
| 366 | } |
| 367 | |
| 368 | /** |
| 369 | * @return A virtual computing instance's hostname |
| 370 | */ |
| 371 | public String getHostname() { |
| 372 | return hostname; |
| 373 | } |
| 374 | |
| 375 | /** |
| 376 | * @return Unique ID for a computing instance. |
| 377 | */ |
| 378 | public int getId() { |
| 379 | return id; |
| 380 | } |
| 381 | |
| 382 | /** |
| 383 | * @return The last timestamp of when the guest was verified as a resident virtual machine on the |
| 384 | * host's hypervisor platform. |
| 385 | */ |
| 386 | |
| 387 | public Date getLastVerifiedDate() { |
| 388 | return lastVerifiedDate; |
| 389 | } |
| 390 | |
| 391 | /** |
| 392 | * @return The maximum amount of CPU resources a computing instance may utilize. |
| 393 | */ |
| 394 | public int getMaxCpu() { |
| 395 | return maxCpu; |
| 396 | } |
| 397 | |
| 398 | /** |
| 399 | * @return The unit of the maximum amount of CPU resources a computing instance may utilize. |
| 400 | */ |
| 401 | public String getMaxCpuUnits() { |
| 402 | return maxCpuUnits; |
| 403 | } |
| 404 | |
| 405 | /** |
| 406 | * @return The maximum amount of memory a computing instance may utilize. |
| 407 | */ |
| 408 | public int getMaxMemory() { |
| 409 | return maxMemory; |
| 410 | } |
| 411 | |
| 412 | /** |
| 413 | * @return The date of the most recent metric tracking poll performed. |
| 414 | */ |
| 415 | public Date getMetricPollDate() { |
| 416 | return metricPollDate; |
| 417 | } |
| 418 | |
| 419 | /** |
| 420 | * @return The date a virtual computing instance was last modified. |
| 421 | */ |
| 422 | public Date getModifyDate() { |
| 423 | return modifyDate; |
| 424 | } |
| 425 | |
| 426 | /** |
| 427 | * @return A small note about a cloud instance to use at your discretion. |
| 428 | */ |
| 429 | public String getNotes() { |
| 430 | return notes; |
| 431 | } |
| 432 | |
| 433 | /** |
| 434 | * @return Whether the computing instance only has access to the private network. |
| 435 | */ |
| 436 | public boolean isPrivateNetworkOnly() { |
| 437 | return privateNetworkOnly; |
| 438 | } |
| 439 | |
| 440 | /** |
| 441 | * @return The number of CPUs available to a computing instance upon startup. |
| 442 | */ |
| 443 | public int getStartCpus() { |
| 444 | return startCpus; |
| 445 | } |
| 446 | |
| 447 | /** |
| 448 | * @return A computing instances status ID |
| 449 | */ |
| 450 | public int getStatusId() { |
| 451 | return statusId; |
| 452 | } |
| 453 | |
| 454 | /** |
| 455 | * @return Unique ID for a computing instance's record on a virtualization platform. |
| 456 | */ |
| 457 | public String getUuid() { |
| 458 | return uuid; |
| 459 | } |
| 460 | |
| 461 | /** |
| 462 | * @return private ip address |
| 463 | */ |
| 464 | public String getPrimaryBackendIpAddress() { |
| 465 | return primaryBackendIpAddress; |
| 466 | } |
| 467 | |
| 468 | /** |
| 469 | * @return public ip address |
| 470 | */ |
| 471 | public String getPrimaryIpAddress() { |
| 472 | return primaryIpAddress; |
| 473 | } |
| 474 | |
| 475 | /** |
| 476 | * @return The billing item for a CloudLayer Compute Instance. |
| 477 | */ |
| 478 | public int getBillingItemId() { |
| 479 | return billingItemId; |
| 480 | } |
| 481 | |
| 482 | /** |
| 483 | * @return A guest's operating system. |
| 484 | */ |
| 485 | public OperatingSystem getOperatingSystem() { |
| 486 | return operatingSystem; |
| 487 | } |
| 488 | |
| 489 | /** |
| 490 | * @return The guest's datacenter |
| 491 | */ |
| 492 | public Datacenter getDatacenter() { |
| 493 | return datacenter; |
| 494 | } |
| 495 | |
| 496 | /** |
| 497 | * @return The current power state of a virtual guest. |
| 498 | */ |
| 499 | public PowerState getPowerState() { |
| 500 | return powerState; |
| 501 | } |
| 502 | |
| 503 | |
| 504 | @Override |
| 505 | public int hashCode() { |
| 506 | final int prime = 31; |
| 507 | int result = 1; |
| 508 | result = prime * result + (accountId ^ (accountId >>> 32)); |
| 509 | result = prime * result + ((createDate == null) ? 0 : createDate.hashCode()); |
| 510 | result = prime * result + (dedicatedAccountHostOnly ? 1231 : 1237); |
| 511 | result = prime * result + ((domain == null) ? 0 : domain.hashCode()); |
| 512 | result = prime * result + ((fullyQualifiedDomainName == null) ? 0 : fullyQualifiedDomainName.hashCode()); |
| 513 | result = prime * result + ((hostname == null) ? 0 : hostname.hashCode()); |
| 514 | result = prime * result + (id ^ (id >>> 32)); |
| 515 | result = prime * result + ((lastVerifiedDate == null) ? 0 : lastVerifiedDate.hashCode()); |
| 516 | result = prime * result + maxCpu; |
| 517 | result = prime * result + ((maxCpuUnits == null) ? 0 : maxCpuUnits.hashCode()); |
| 518 | result = prime * result + maxMemory; |
| 519 | result = prime * result + ((metricPollDate == null) ? 0 : metricPollDate.hashCode()); |
| 520 | result = prime * result + ((modifyDate == null) ? 0 : modifyDate.hashCode()); |
| 521 | result = prime * result + ((notes == null) ? 0 : notes.hashCode()); |
| 522 | result = prime * result + ((primaryBackendIpAddress == null) ? 0 : primaryBackendIpAddress.hashCode()); |
| 523 | result = prime * result + ((primaryIpAddress == null) ? 0 : primaryIpAddress.hashCode()); |
| 524 | result = prime * result + (privateNetworkOnly ? 1231 : 1237); |
| 525 | result = prime * result + startCpus; |
| 526 | result = prime * result + statusId; |
| 527 | result = prime * result + ((uuid == null) ? 0 : uuid.hashCode()); |
| 528 | result = prime * result + (getBillingItemId() ^ (getBillingItemId() >>> 32)); |
| 529 | result = prime * result + ((operatingSystem == null) ? 0 : operatingSystem.hashCode()); |
| 530 | result = prime * result + ((datacenter == null) ? 0 : datacenter.hashCode()); |
| 531 | result = prime * result + ((powerState == null) ? 0 : powerState.hashCode()); |
| 532 | return result; |
| 533 | } |
| 534 | |
| 535 | @Override |
| 536 | public boolean equals(Object obj) { |
| 537 | if (this == obj) |
| 538 | return true; |
| 539 | if (obj == null) |
| 540 | return false; |
| 541 | if (getClass() != obj.getClass()) |
| 542 | return false; |
| 543 | VirtualGuest other = (VirtualGuest) obj; |
| 544 | if (accountId != other.accountId) |
| 545 | return false; |
| 546 | if (createDate == null) { |
| 547 | if (other.createDate != null) |
| 548 | return false; |
| 549 | } else if (!createDate.equals(other.createDate)) |
| 550 | return false; |
| 551 | if (dedicatedAccountHostOnly != other.dedicatedAccountHostOnly) |
| 552 | return false; |
| 553 | if (domain == null) { |
| 554 | if (other.domain != null) |
| 555 | return false; |
| 556 | } else if (!domain.equals(other.domain)) |
| 557 | return false; |
| 558 | if (fullyQualifiedDomainName == null) { |
| 559 | if (other.fullyQualifiedDomainName != null) |
| 560 | return false; |
| 561 | } else if (!fullyQualifiedDomainName.equals(other.fullyQualifiedDomainName)) |
| 562 | return false; |
| 563 | if (hostname == null) { |
| 564 | if (other.hostname != null) |
| 565 | return false; |
| 566 | } else if (!hostname.equals(other.hostname)) |
| 567 | return false; |
| 568 | if (id != other.id) |
| 569 | return false; |
| 570 | if (lastVerifiedDate == null) { |
| 571 | if (other.lastVerifiedDate != null) |
| 572 | return false; |
| 573 | } else if (!lastVerifiedDate.equals(other.lastVerifiedDate)) |
| 574 | return false; |
| 575 | if (maxCpu != other.maxCpu) |
| 576 | return false; |
| 577 | if (maxCpuUnits == null) { |
| 578 | if (other.maxCpuUnits != null) |
| 579 | return false; |
| 580 | } else if (!maxCpuUnits.equals(other.maxCpuUnits)) |
| 581 | return false; |
| 582 | if (maxMemory != other.maxMemory) |
| 583 | return false; |
| 584 | if (metricPollDate == null) { |
| 585 | if (other.metricPollDate != null) |
| 586 | return false; |
| 587 | } else if (!metricPollDate.equals(other.metricPollDate)) |
| 588 | return false; |
| 589 | if (modifyDate == null) { |
| 590 | if (other.modifyDate != null) |
| 591 | return false; |
| 592 | } else if (!modifyDate.equals(other.modifyDate)) |
| 593 | return false; |
| 594 | if (notes == null) { |
| 595 | if (other.notes != null) |
| 596 | return false; |
| 597 | } else if (!notes.equals(other.notes)) |
| 598 | return false; |
| 599 | if (primaryBackendIpAddress == null) { |
| 600 | if (other.primaryBackendIpAddress != null) |
| 601 | return false; |
| 602 | } else if (!primaryBackendIpAddress.equals(other.primaryBackendIpAddress)) |
| 603 | return false; |
| 604 | if (primaryIpAddress == null) { |
| 605 | if (other.primaryIpAddress != null) |
| 606 | return false; |
| 607 | } else if (!primaryIpAddress.equals(other.primaryIpAddress)) |
| 608 | return false; |
| 609 | if (privateNetworkOnly != other.privateNetworkOnly) |
| 610 | return false; |
| 611 | if (startCpus != other.startCpus) |
| 612 | return false; |
| 613 | if (statusId != other.statusId) |
| 614 | return false; |
| 615 | if (uuid == null) { |
| 616 | if (other.uuid != null) |
| 617 | return false; |
| 618 | } else if (!uuid.equals(other.uuid)) |
| 619 | return false; |
| 620 | if (getBillingItemId() != other.getBillingItemId()) |
| 621 | return false; |
| 622 | if (operatingSystem == null) { |
| 623 | if (other.operatingSystem != null) |
| 624 | return false; |
| 625 | } else if (!operatingSystem.equals(other.operatingSystem)) |
| 626 | return false; |
| 627 | if (datacenter == null) { |
| 628 | if (other.datacenter != null) |
| 629 | return false; |
| 630 | } else if (!datacenter.equals(other.datacenter)) |
| 631 | return false; |
| 632 | if (powerState == null) { |
| 633 | if (other.powerState != null) |
| 634 | return false; |
| 635 | } else if (!powerState.equals(other.powerState)) |
| 636 | return false; |
| 637 | return true; |
| 638 | } |
| 639 | |
| 640 | @Override |
| 641 | public String toString() { |
| 642 | return "[accountId=" + accountId + ", createDate=" + createDate + ", dedicatedAccountHostOnly=" |
| 643 | + dedicatedAccountHostOnly + ", domain=" + domain + ", fullyQualifiedDomainName=" |
| 644 | + fullyQualifiedDomainName + ", hostname=" + hostname + ", id=" + id + ", lastVerifiedDate=" |
| 645 | + lastVerifiedDate + ", maxCpu=" + maxCpu + ", maxCpuUnits=" + maxCpuUnits + ", maxMemory=" + maxMemory |
| 646 | + ", metricPollDate=" + metricPollDate + ", modifyDate=" + modifyDate + ", notes=" + notes |
| 647 | + ", primaryBackendIpAddress=" + primaryBackendIpAddress + ", primaryIpAddress=" + primaryIpAddress |
| 648 | + ", privateNetworkOnly=" + privateNetworkOnly + ", startCpus=" + startCpus + ", statusId=" + statusId |
| 649 | + ", uuid=" + uuid + ", billingItemId="+getBillingItemId()+", operatingSystem="+operatingSystem+", datacenter="+datacenter |
| 650 | + ", powerState="+powerState+"]"; |
| 651 | } |
| 652 | |
| 653 | } |