@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getVolumeId() == null) ? 0 : getVolumeId().hashCode()); hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode()); hashCode = prime * hashCode + ((getDevice() == null) ? 0 : getDevice().hashCode()); hashCode = prime * hashCode + ((isForce() == null) ? 0 : isForce().hashCode()); return hashCode; }
/** * 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 (getVolumeId() != null) sb.append("VolumeId: " + getVolumeId() + ","); if (getInstanceId() != null) sb.append("InstanceId: " + getInstanceId() + ","); if (getDevice() != null) sb.append("Device: " + getDevice() + ","); if (isForce() != null) sb.append("Force: " + isForce() ); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DetachVolumeRequest == false) return false; DetachVolumeRequest other = (DetachVolumeRequest)obj; if (other.getVolumeId() == null ^ this.getVolumeId() == null) return false; if (other.getVolumeId() != null && other.getVolumeId().equals(this.getVolumeId()) == false) return false; if (other.getInstanceId() == null ^ this.getInstanceId() == null) return false; if (other.getInstanceId() != null && other.getInstanceId().equals(this.getInstanceId()) == false) return false; if (other.getDevice() == null ^ this.getDevice() == null) return false; if (other.getDevice() != null && other.getDevice().equals(this.getDevice()) == false) return false; if (other.isForce() == null ^ this.isForce() == null) return false; if (other.isForce() != null && other.isForce().equals(this.isForce()) == false) return false; return true; }
public Request<DetachVolumeRequest> marshall(DetachVolumeRequest detachVolumeRequest) { if (detachVolumeRequest == null) { throw new AmazonClientException("Invalid argument passed to marshall(...)"); } Request<DetachVolumeRequest> request = new DefaultRequest<DetachVolumeRequest>(detachVolumeRequest, "AmazonEC2"); request.addParameter("Action", "DetachVolume"); request.addParameter("Version", "2015-10-01"); if (detachVolumeRequest.getVolumeId() != null) { request.addParameter("VolumeId", StringUtils.fromString(detachVolumeRequest.getVolumeId())); } if (detachVolumeRequest.getInstanceId() != null) { request.addParameter("InstanceId", StringUtils.fromString(detachVolumeRequest.getInstanceId())); } if (detachVolumeRequest.getDevice() != null) { request.addParameter("Device", StringUtils.fromString(detachVolumeRequest.getDevice())); } if (detachVolumeRequest.isForce() != null) { request.addParameter("Force", StringUtils.fromBoolean(detachVolumeRequest.isForce())); } return request; } }