public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) { switch (fieldName) { case "Destination": return Optional.ofNullable(clazz.cast(destination())); case "DeliveryMedium": return Optional.ofNullable(clazz.cast(deliveryMediumAsString())); case "AttributeName": return Optional.ofNullable(clazz.cast(attributeName())); default: return Optional.empty(); } }
@Override public String toString() { return ToString.builder("CodeDeliveryDetailsType").add("Destination", destination()) .add("DeliveryMedium", deliveryMediumAsString()).add("AttributeName", attributeName()).build(); }
/** * 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("CodeDeliveryDetailsType").add("Destination", destination()) .add("DeliveryMedium", deliveryMediumAsString()).add("AttributeName", attributeName()).build(); }
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) { switch (fieldName) { case "Destination": return Optional.ofNullable(clazz.cast(destination())); case "DeliveryMedium": return Optional.ofNullable(clazz.cast(deliveryMediumAsString())); case "AttributeName": return Optional.ofNullable(clazz.cast(attributeName())); default: return Optional.empty(); } }
@Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(destination()); hashCode = 31 * hashCode + Objects.hashCode(deliveryMediumAsString()); hashCode = 31 * hashCode + Objects.hashCode(attributeName()); return hashCode; }
@Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(destination()); hashCode = 31 * hashCode + Objects.hashCode(deliveryMediumAsString()); hashCode = 31 * hashCode + Objects.hashCode(attributeName()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof CodeDeliveryDetailsType)) { return false; } CodeDeliveryDetailsType other = (CodeDeliveryDetailsType) obj; return Objects.equals(destination(), other.destination()) && Objects.equals(deliveryMediumAsString(), other.deliveryMediumAsString()) && Objects.equals(attributeName(), other.attributeName()); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof CodeDeliveryDetailsType)) { return false; } CodeDeliveryDetailsType other = (CodeDeliveryDetailsType) obj; return Objects.equals(destination(), other.destination()) && Objects.equals(deliveryMediumAsString(), other.deliveryMediumAsString()) && Objects.equals(attributeName(), other.attributeName()); }
/** * Marshall the given parameter object */ public void marshall(CodeDeliveryDetailsType codeDeliveryDetailsType, ProtocolMarshaller protocolMarshaller) { Validate.paramNotNull(codeDeliveryDetailsType, "codeDeliveryDetailsType"); Validate.paramNotNull(protocolMarshaller, "protocolMarshaller"); try { protocolMarshaller.marshall(codeDeliveryDetailsType.destination(), DESTINATION_BINDING); protocolMarshaller.marshall(codeDeliveryDetailsType.deliveryMediumAsString(), DELIVERYMEDIUM_BINDING); protocolMarshaller.marshall(codeDeliveryDetailsType.attributeName(), ATTRIBUTENAME_BINDING); } catch (Exception e) { throw SdkClientException.builder().message("Unable to marshall request to JSON: " + e.getMessage()).cause(e).build(); } } }