@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode()); hashCode = prime * hashCode + ((getServerName() == null) ? 0 : getServerName().hashCode()); hashCode = prime * hashCode + ((getMessage() == null) ? 0 : getMessage().hashCode()); hashCode = prime * hashCode + ((getLogUrl() == null) ? 0 : getLogUrl().hashCode()); return hashCode; }
/** * <p> * The time when the event occurred. * </p> * * @param createdAt * The time when the event occurred. * @return Returns a reference to this object so that method calls can be chained together. */ public ServerEvent withCreatedAt(java.util.Date createdAt) { setCreatedAt(createdAt); return this; }
/** * <p> * The Amazon S3 URL of the event's log file. * </p> * * @param logUrl * The Amazon S3 URL of the event's log file. * @return Returns a reference to this object so that method calls can be chained together. */ public ServerEvent withLogUrl(String logUrl) { setLogUrl(logUrl); return this; }
public ServerEvent unmarshall(JsonUnmarshallerContext context) throws Exception { ServerEvent serverEvent = new ServerEvent(); if (context.testExpression("CreatedAt", targetDepth)) { context.nextToken(); serverEvent.setCreatedAt(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context)); serverEvent.setServerName(context.getUnmarshaller(String.class).unmarshall(context)); serverEvent.setMessage(context.getUnmarshaller(String.class).unmarshall(context)); serverEvent.setLogUrl(context.getUnmarshaller(String.class).unmarshall(context));
/** * <p> * The name of the server on or for which the event occurred. * </p> * * @param serverName * The name of the server on or for which the event occurred. * @return Returns a reference to this object so that method calls can be chained together. */ public ServerEvent withServerName(String serverName) { setServerName(serverName); return this; }
/** * <p> * A human-readable informational or status message. * </p> * * @param message * A human-readable informational or status message. * @return Returns a reference to this object so that method calls can be chained together. */ public ServerEvent withMessage(String message) { setMessage(message); return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ServerEvent == false) return false; ServerEvent other = (ServerEvent) obj; if (other.getCreatedAt() == null ^ this.getCreatedAt() == null) return false; if (other.getCreatedAt() != null && other.getCreatedAt().equals(this.getCreatedAt()) == false) return false; if (other.getServerName() == null ^ this.getServerName() == null) return false; if (other.getServerName() != null && other.getServerName().equals(this.getServerName()) == false) return false; if (other.getMessage() == null ^ this.getMessage() == null) return false; if (other.getMessage() != null && other.getMessage().equals(this.getMessage()) == false) return false; if (other.getLogUrl() == null ^ this.getLogUrl() == null) return false; if (other.getLogUrl() != null && other.getLogUrl().equals(this.getLogUrl()) == false) return false; return true; }
/** * 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 (getCreatedAt() != null) sb.append("CreatedAt: ").append(getCreatedAt()).append(","); if (getServerName() != null) sb.append("ServerName: ").append(getServerName()).append(","); if (getMessage() != null) sb.append("Message: ").append(getMessage()).append(","); if (getLogUrl() != null) sb.append("LogUrl: ").append(getLogUrl()); sb.append("}"); return sb.toString(); }
/** * Marshall the given parameter object. */ public void marshall(ServerEvent serverEvent, ProtocolMarshaller protocolMarshaller) { if (serverEvent == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(serverEvent.getCreatedAt(), CREATEDAT_BINDING); protocolMarshaller.marshall(serverEvent.getServerName(), SERVERNAME_BINDING); protocolMarshaller.marshall(serverEvent.getMessage(), MESSAGE_BINDING); protocolMarshaller.marshall(serverEvent.getLogUrl(), LOGURL_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }