/** * 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("AttributeType").add("Name", name()) .add("Value", value() == null ? null : "*** Sensitive Data Redacted ***").build(); }
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) { switch (fieldName) { case "Name": return Optional.ofNullable(clazz.cast(name())); case "Value": return Optional.ofNullable(clazz.cast(value())); default: return Optional.empty(); } }
@Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(value()); return hashCode; }
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) { switch (fieldName) { case "Name": return Optional.ofNullable(clazz.cast(name())); case "Value": return Optional.ofNullable(clazz.cast(value())); default: return Optional.empty(); } }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof AttributeType)) { return false; } AttributeType other = (AttributeType) obj; return Objects.equals(name(), other.name()) && Objects.equals(value(), other.value()); }
@Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(value()); return hashCode; }
@Override public String toString() { return ToString.builder("AttributeType").add("Name", name()).add("Value", value()).build(); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof AttributeType)) { return false; } AttributeType other = (AttributeType) obj; return Objects.equals(name(), other.name()) && Objects.equals(value(), other.value()); }
/** * Marshall the given parameter object */ public void marshall(AttributeType attributeType, ProtocolMarshaller protocolMarshaller) { Validate.paramNotNull(attributeType, "attributeType"); Validate.paramNotNull(protocolMarshaller, "protocolMarshaller"); try { protocolMarshaller.marshall(attributeType.name(), NAME_BINDING); protocolMarshaller.marshall(attributeType.value(), VALUE_BINDING); } catch (Exception e) { throw SdkClientException.builder().message("Unable to marshall request to JSON: " + e.getMessage()).cause(e).build(); } } }