/** * 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("DeviceType").add("DeviceKey", deviceKey()).add("DeviceAttributes", deviceAttributes()) .add("DeviceCreateDate", deviceCreateDate()).add("DeviceLastModifiedDate", deviceLastModifiedDate()) .add("DeviceLastAuthenticatedDate", deviceLastAuthenticatedDate()).build(); }
@Override public String toString() { return ToString.builder("DeviceType").add("DeviceKey", deviceKey()).add("DeviceAttributes", deviceAttributes()) .add("DeviceCreateDate", deviceCreateDate()).add("DeviceLastModifiedDate", deviceLastModifiedDate()) .add("DeviceLastAuthenticatedDate", deviceLastAuthenticatedDate()).build(); }
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) { switch (fieldName) { case "DeviceKey": return Optional.ofNullable(clazz.cast(deviceKey())); case "DeviceAttributes": return Optional.ofNullable(clazz.cast(deviceAttributes())); case "DeviceCreateDate": return Optional.ofNullable(clazz.cast(deviceCreateDate())); case "DeviceLastModifiedDate": return Optional.ofNullable(clazz.cast(deviceLastModifiedDate())); case "DeviceLastAuthenticatedDate": return Optional.ofNullable(clazz.cast(deviceLastAuthenticatedDate())); default: return Optional.empty(); } }
@Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(deviceKey()); hashCode = 31 * hashCode + Objects.hashCode(deviceAttributes()); hashCode = 31 * hashCode + Objects.hashCode(deviceCreateDate()); hashCode = 31 * hashCode + Objects.hashCode(deviceLastModifiedDate()); hashCode = 31 * hashCode + Objects.hashCode(deviceLastAuthenticatedDate()); return hashCode; }
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) { switch (fieldName) { case "DeviceKey": return Optional.ofNullable(clazz.cast(deviceKey())); case "DeviceAttributes": return Optional.ofNullable(clazz.cast(deviceAttributes())); case "DeviceCreateDate": return Optional.ofNullable(clazz.cast(deviceCreateDate())); case "DeviceLastModifiedDate": return Optional.ofNullable(clazz.cast(deviceLastModifiedDate())); case "DeviceLastAuthenticatedDate": return Optional.ofNullable(clazz.cast(deviceLastAuthenticatedDate())); default: return Optional.empty(); } }
@Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(deviceKey()); hashCode = 31 * hashCode + Objects.hashCode(deviceAttributes()); hashCode = 31 * hashCode + Objects.hashCode(deviceCreateDate()); hashCode = 31 * hashCode + Objects.hashCode(deviceLastModifiedDate()); hashCode = 31 * hashCode + Objects.hashCode(deviceLastAuthenticatedDate()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof DeviceType)) { return false; } DeviceType other = (DeviceType) obj; return Objects.equals(deviceKey(), other.deviceKey()) && Objects.equals(deviceAttributes(), other.deviceAttributes()) && Objects.equals(deviceCreateDate(), other.deviceCreateDate()) && Objects.equals(deviceLastModifiedDate(), other.deviceLastModifiedDate()) && Objects.equals(deviceLastAuthenticatedDate(), other.deviceLastAuthenticatedDate()); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof DeviceType)) { return false; } DeviceType other = (DeviceType) obj; return Objects.equals(deviceKey(), other.deviceKey()) && Objects.equals(deviceAttributes(), other.deviceAttributes()) && Objects.equals(deviceCreateDate(), other.deviceCreateDate()) && Objects.equals(deviceLastModifiedDate(), other.deviceLastModifiedDate()) && Objects.equals(deviceLastAuthenticatedDate(), other.deviceLastAuthenticatedDate()); }
/** * Marshall the given parameter object */ public void marshall(DeviceType deviceType, ProtocolMarshaller protocolMarshaller) { Validate.paramNotNull(deviceType, "deviceType"); Validate.paramNotNull(protocolMarshaller, "protocolMarshaller"); try { protocolMarshaller.marshall(deviceType.deviceKey(), DEVICEKEY_BINDING); protocolMarshaller.marshall(deviceType.deviceAttributes(), DEVICEATTRIBUTES_BINDING); protocolMarshaller.marshall(deviceType.deviceCreateDate(), DEVICECREATEDATE_BINDING); protocolMarshaller.marshall(deviceType.deviceLastModifiedDate(), DEVICELASTMODIFIEDDATE_BINDING); protocolMarshaller.marshall(deviceType.deviceLastAuthenticatedDate(), DEVICELASTAUTHENTICATEDDATE_BINDING); } catch (Exception e) { throw SdkClientException.builder().message("Unable to marshall request to JSON: " + e.getMessage()).cause(e).build(); } } }