@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDeviceName() == null) ? 0 : getDeviceName().hashCode()); hashCode = prime * hashCode + ((getEbs() == null) ? 0 : getEbs().hashCode()); return hashCode; }
/** * 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 (getDeviceName() != null) sb.append("DeviceName: ").append(getDeviceName()).append(","); if (getEbs() != null) sb.append("Ebs: ").append(getEbs()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof InstanceBlockDeviceMapping == false) return false; InstanceBlockDeviceMapping other = (InstanceBlockDeviceMapping) obj; if (other.getDeviceName() == null ^ this.getDeviceName() == null) return false; if (other.getDeviceName() != null && other.getDeviceName().equals(this.getDeviceName()) == false) return false; if (other.getEbs() == null ^ this.getEbs() == null) return false; if (other.getEbs() != null && other.getEbs().equals(this.getEbs()) == false) return false; return true; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof InstanceBlockDeviceMapping == false) return false; InstanceBlockDeviceMapping other = (InstanceBlockDeviceMapping)obj; if (other.getDeviceName() == null ^ this.getDeviceName() == null) return false; if (other.getDeviceName() != null && other.getDeviceName().equals(this.getDeviceName()) == false) return false; if (other.getEbs() == null ^ this.getEbs() == null) return false; if (other.getEbs() != null && other.getEbs().equals(this.getEbs()) == 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 (getDeviceName() != null) sb.append("DeviceName: " + getDeviceName() + ","); if (getEbs() != null) sb.append("Ebs: " + getEbs() ); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDeviceName() == null) ? 0 : getDeviceName().hashCode()); hashCode = prime * hashCode + ((getEbs() == null) ? 0 : getEbs().hashCode()); return hashCode; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDeviceName() == null) ? 0 : getDeviceName().hashCode()); hashCode = prime * hashCode + ((getEbs() == null) ? 0 : getEbs().hashCode()); return hashCode; }
/** * 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 (getDeviceName() != null) sb.append("DeviceName: ").append(getDeviceName()).append(","); if (getEbs() != null) sb.append("Ebs: ").append(getEbs()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof InstanceBlockDeviceMapping == false) return false; InstanceBlockDeviceMapping other = (InstanceBlockDeviceMapping) obj; if (other.getDeviceName() == null ^ this.getDeviceName() == null) return false; if (other.getDeviceName() != null && other.getDeviceName().equals(this.getDeviceName()) == false) return false; if (other.getEbs() == null ^ this.getEbs() == null) return false; if (other.getEbs() != null && other.getEbs().equals(this.getEbs()) == false) return false; return true; }
protected InstanceBlockDeviceMapping getRootVolumeMapping(Instance instance) { checkNotNull(instance, "instance"); String rootDeviceName = instance.getRootDeviceName(); List<InstanceBlockDeviceMapping> mappings = instance.getBlockDeviceMappings(); for (InstanceBlockDeviceMapping mapping : mappings) { if (rootDeviceName.equals(mapping.getDeviceName())) { return mapping; } } throw illegalState("Unable to locate the root volume mapping for [%s]", instance.getInstanceId()); }
protected BlockDeviceMapping convert(InstanceBlockDeviceMapping mapping, String snapshotId, int sizeInGigabytes) { BlockDeviceMapping converted = new BlockDeviceMapping(); converted.setDeviceName(mapping.getDeviceName()); converted.setEbs(convert(mapping.getEbs(), snapshotId, sizeInGigabytes)); return converted; }
protected BlockDeviceMapping getRootVolumeMapping(Instance instance, String snapshotId, RootVolume rootVolume) { InstanceBlockDeviceMapping ibdm = getRootVolumeMapping(instance); EbsBlockDevice ebs = new EbsBlockDevice(); ebs.setDeleteOnTermination(rootVolume.getDeleteOnTermination().orNull()); ebs.setSnapshotId(snapshotId); ebs.setVolumeSize(rootVolume.getSizeInGigabytes().orNull()); BlockDeviceMapping bdm = new BlockDeviceMapping(); bdm.setDeviceName(ibdm.getDeviceName()); bdm.setEbs(ebs); return bdm; }