Esempio n. 1
0
 @Override
 public boolean equals(Object o) {
   ApiHost that = ApiUtils.baseEquals(this, o);
   return this == that || (that != null && Objects.equal(hostId, that.getHostId()));
 }
Esempio n. 2
0
 /**
  * Copy constructor
  *
  * @param host The host to copy
  */
 public ApiHost(ApiHost host) {
   Preconditions.checkNotNull(host, "Cannot copy a null host");
   this.hostId = host.getHostId();
   this.ipAddress = host.getIpAddress();
   this.hostname = host.getHostname();
   this.rackId = host.getRackId();
   this.hostUrl = host.getHostUrl();
   this.lastHeartbeat = host.getLastHeartbeat();
   this.healthSummary = host.getHealthSummary();
   this.healthChecks = host.getHealthChecks();
   List<ApiRoleRef> refs = host.getRoleRefs();
   if (refs != null) {
     this.roleRefs = Lists.newArrayList(refs);
   } else {
     this.roleRefs = Lists.newArrayList();
   }
   this.maintenanceMode = host.getMaintenanceMode();
   this.maintenanceOwners = host.getMaintenanceOwners();
   this.commissionState = host.getCommissionState();
   this.config = host.getConfig();
   this.numCores = host.getNumCores();
   this.totalPhysMemBytes = host.getTotalPhysMemBytes();
 }