throughput_info.readCapacityUnits().longValue()); System.out.format(" Write Capacity: %d\n", throughput_info.writeCapacityUnits().longValue());
/** * 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. */ @Override public String toString() { return ToString.builder("ProvisionedThroughputDescription").add("LastIncreaseDateTime", lastIncreaseDateTime()) .add("LastDecreaseDateTime", lastDecreaseDateTime()).add("NumberOfDecreasesToday", numberOfDecreasesToday()) .add("ReadCapacityUnits", readCapacityUnits()).add("WriteCapacityUnits", writeCapacityUnits()).build(); }
@Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(lastIncreaseDateTime()); hashCode = 31 * hashCode + Objects.hashCode(lastDecreaseDateTime()); hashCode = 31 * hashCode + Objects.hashCode(numberOfDecreasesToday()); hashCode = 31 * hashCode + Objects.hashCode(readCapacityUnits()); hashCode = 31 * hashCode + Objects.hashCode(writeCapacityUnits()); return hashCode; }
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) { switch (fieldName) { case "LastIncreaseDateTime": return Optional.ofNullable(clazz.cast(lastIncreaseDateTime())); case "LastDecreaseDateTime": return Optional.ofNullable(clazz.cast(lastDecreaseDateTime())); case "NumberOfDecreasesToday": return Optional.ofNullable(clazz.cast(numberOfDecreasesToday())); case "ReadCapacityUnits": return Optional.ofNullable(clazz.cast(readCapacityUnits())); case "WriteCapacityUnits": return Optional.ofNullable(clazz.cast(writeCapacityUnits())); default: return Optional.empty(); } }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof ProvisionedThroughputDescription)) { return false; } ProvisionedThroughputDescription other = (ProvisionedThroughputDescription) obj; return Objects.equals(lastIncreaseDateTime(), other.lastIncreaseDateTime()) && Objects.equals(lastDecreaseDateTime(), other.lastDecreaseDateTime()) && Objects.equals(numberOfDecreasesToday(), other.numberOfDecreasesToday()) && Objects.equals(readCapacityUnits(), other.readCapacityUnits()) && Objects.equals(writeCapacityUnits(), other.writeCapacityUnits()); }