/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getAvailabilityZone() != null) sb.append("AvailabilityZone: ").append(getAvailabilityZone()).append(","); if (getEvents() != null) sb.append("Events: ").append(getEvents()).append(","); if (getInstanceId() != null) sb.append("InstanceId: ").append(getInstanceId()).append(","); if (getInstanceState() != null) sb.append("InstanceState: ").append(getInstanceState()).append(","); if (getInstanceStatus() != null) sb.append("InstanceStatus: ").append(getInstanceStatus()).append(","); if (getSystemStatus() != null) sb.append("SystemStatus: ").append(getSystemStatus()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAvailabilityZone() == null) ? 0 : getAvailabilityZone().hashCode()); hashCode = prime * hashCode + ((getEvents() == null) ? 0 : getEvents().hashCode()); hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode()); hashCode = prime * hashCode + ((getInstanceState() == null) ? 0 : getInstanceState().hashCode()); hashCode = prime * hashCode + ((getInstanceStatus() == null) ? 0 : getInstanceStatus().hashCode()); hashCode = prime * hashCode + ((getSystemStatus() == null) ? 0 : getSystemStatus().hashCode()); return hashCode; }
if (other.getInstanceStatus() != null && other.getInstanceStatus().equals(this.getInstanceStatus()) == false) return false; if (other.getSystemStatus() == null ^ this.getSystemStatus() == null) return false; if (other.getSystemStatus() != null && other.getSystemStatus().equals(this.getSystemStatus()) == false) return false; return true;
/** * 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 (getInstanceId() != null) sb.append("InstanceId: " + getInstanceId() + ","); if (getAvailabilityZone() != null) sb.append("AvailabilityZone: " + getAvailabilityZone() + ","); if (getEvents() != null) sb.append("Events: " + getEvents() + ","); if (getInstanceState() != null) sb.append("InstanceState: " + getInstanceState() + ","); if (getSystemStatus() != null) sb.append("SystemStatus: " + getSystemStatus() + ","); if (getInstanceStatus() != null) sb.append("InstanceStatus: " + getInstanceStatus() ); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode()); hashCode = prime * hashCode + ((getAvailabilityZone() == null) ? 0 : getAvailabilityZone().hashCode()); hashCode = prime * hashCode + ((getEvents() == null) ? 0 : getEvents().hashCode()); hashCode = prime * hashCode + ((getInstanceState() == null) ? 0 : getInstanceState().hashCode()); hashCode = prime * hashCode + ((getSystemStatus() == null) ? 0 : getSystemStatus().hashCode()); hashCode = prime * hashCode + ((getInstanceStatus() == null) ? 0 : getInstanceStatus().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof InstanceStatus == false) return false; InstanceStatus other = (InstanceStatus)obj; if (other.getInstanceId() == null ^ this.getInstanceId() == null) return false; if (other.getInstanceId() != null && other.getInstanceId().equals(this.getInstanceId()) == false) return false; if (other.getAvailabilityZone() == null ^ this.getAvailabilityZone() == null) return false; if (other.getAvailabilityZone() != null && other.getAvailabilityZone().equals(this.getAvailabilityZone()) == false) return false; if (other.getEvents() == null ^ this.getEvents() == null) return false; if (other.getEvents() != null && other.getEvents().equals(this.getEvents()) == false) return false; if (other.getInstanceState() == null ^ this.getInstanceState() == null) return false; if (other.getInstanceState() != null && other.getInstanceState().equals(this.getInstanceState()) == false) return false; if (other.getSystemStatus() == null ^ this.getSystemStatus() == null) return false; if (other.getSystemStatus() != null && other.getSystemStatus().equals(this.getSystemStatus()) == false) return false; if (other.getInstanceStatus() == null ^ this.getInstanceStatus() == null) return false; if (other.getInstanceStatus() != null && other.getInstanceStatus().equals(this.getInstanceStatus()) == false) return false; return true; }
protected InstanceStatusSummary getSummary(InstanceStatus status, InstanceStatusType type) { switch (type) { case INSTANCE: return status.getInstanceStatus(); case SYSTEM: return status.getSystemStatus(); default: throw new IllegalArgumentException("[" + type + "] is unknown"); } }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getAvailabilityZone() != null) sb.append("AvailabilityZone: ").append(getAvailabilityZone()).append(","); if (getEvents() != null) sb.append("Events: ").append(getEvents()).append(","); if (getInstanceId() != null) sb.append("InstanceId: ").append(getInstanceId()).append(","); if (getInstanceState() != null) sb.append("InstanceState: ").append(getInstanceState()).append(","); if (getInstanceStatus() != null) sb.append("InstanceStatus: ").append(getInstanceStatus()).append(","); if (getSystemStatus() != null) sb.append("SystemStatus: ").append(getSystemStatus()); sb.append("}"); return sb.toString(); }
InstanceStatus raw = awsStatus.getRaw(); String instanceStatus = raw.getInstanceStatus().getStatus(); String systemStatus = raw.getSystemStatus().getStatus();
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAvailabilityZone() == null) ? 0 : getAvailabilityZone().hashCode()); hashCode = prime * hashCode + ((getEvents() == null) ? 0 : getEvents().hashCode()); hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode()); hashCode = prime * hashCode + ((getInstanceState() == null) ? 0 : getInstanceState().hashCode()); hashCode = prime * hashCode + ((getInstanceStatus() == null) ? 0 : getInstanceStatus().hashCode()); hashCode = prime * hashCode + ((getSystemStatus() == null) ? 0 : getSystemStatus().hashCode()); return hashCode; }
"\tstate:" + status.getInstanceState().getName() + "\tstatus:" + status.getInstanceStatus().getStatus() + "\tsystem_status: " + status.getSystemStatus().getStatus() + "\n");
String systemStatus = status.getSystemStatus().getStatus(); List<InstanceStatusEvent> events = status.getEvents();
if (other.getInstanceStatus() != null && other.getInstanceStatus().equals(this.getInstanceStatus()) == false) return false; if (other.getSystemStatus() == null ^ this.getSystemStatus() == null) return false; if (other.getSystemStatus() != null && other.getSystemStatus().equals(this.getSystemStatus()) == false) return false; return true;