@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getEnabled() == null) ? 0 : getEnabled().hashCode()); hashCode = prime * hashCode + ((getAttributeName() == null) ? 0 : getAttributeName().hashCode()); return hashCode; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTimeToLiveSpecification() == null) ? 0 : getTimeToLiveSpecification().hashCode()); return hashCode; }
/** * <p> * The name of the Time to Live attribute used to store the expiration time for items in the table. * </p> * * @param attributeName * The name of the Time to Live attribute used to store the expiration time for items in the table. * @return Returns a reference to this object so that method calls can be chained together. */ public TimeToLiveSpecification withAttributeName(String attributeName) { setAttributeName(attributeName); return this; }
public TimeToLiveSpecification unmarshall(JsonUnmarshallerContext context) throws Exception { TimeToLiveSpecification timeToLiveSpecification = new TimeToLiveSpecification(); if (context.testExpression("Enabled", targetDepth)) { context.nextToken(); timeToLiveSpecification.setEnabled(context.getUnmarshaller(Boolean.class).unmarshall(context)); timeToLiveSpecification.setAttributeName(context.getUnmarshaller(String.class).unmarshall(context));
private void updateTimeToLiveIfAny() { if (this.timeToLive != null) { UpdateTimeToLiveRequest updateTimeToLiveRequest = new UpdateTimeToLiveRequest() .withTableName(this.table.getTableName()) .withTimeToLiveSpecification( new TimeToLiveSpecification() .withAttributeName(TTL) .withEnabled(this.timeToLive > 0)); try { this.dynamoDB.updateTimeToLive(updateTimeToLiveRequest); } catch (AmazonDynamoDBException e) { if (logger.isWarnEnabled()) { logger.warn("The error during 'updateTimeToLive' request", e); } } } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UpdateTimeToLiveResult == false) return false; UpdateTimeToLiveResult other = (UpdateTimeToLiveResult) obj; if (other.getTimeToLiveSpecification() == null ^ this.getTimeToLiveSpecification() == null) return false; if (other.getTimeToLiveSpecification() != null && other.getTimeToLiveSpecification().equals(this.getTimeToLiveSpecification()) == false) return false; return true; }
/** * <p> * Indicates whether Time To Live is to be enabled (true) or disabled (false) on the table. * </p> * * @param enabled * Indicates whether Time To Live is to be enabled (true) or disabled (false) on the table. * @return Returns a reference to this object so that method calls can be chained together. */ public TimeToLiveSpecification withEnabled(Boolean enabled) { setEnabled(enabled); return this; }
public TimeToLiveSpecification unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } TimeToLiveSpecification timeToLiveSpecification = new TimeToLiveSpecification(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("Enabled")) { timeToLiveSpecification.setEnabled(BooleanJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("AttributeName")) { timeToLiveSpecification.setAttributeName(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return timeToLiveSpecification; }
private void updateTimeToLiveIfAny() { if (this.timeToLive != null) { UpdateTimeToLiveRequest updateTimeToLiveRequest = new UpdateTimeToLiveRequest() .withTableName(this.table.getTableName()) .withTimeToLiveSpecification( new TimeToLiveSpecification() .withAttributeName(TTL) .withEnabled(this.timeToLive > 0)); try { this.dynamoDB.updateTimeToLive(updateTimeToLiveRequest); } catch (AmazonDynamoDBException e) { if (logger.isWarnEnabled()) { logger.warn("The error during 'updateTimeToLive' request", e); } } } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UpdateTimeToLiveRequest == false) return false; UpdateTimeToLiveRequest other = (UpdateTimeToLiveRequest) obj; if (other.getTableName() == null ^ this.getTableName() == null) return false; if (other.getTableName() != null && other.getTableName().equals(this.getTableName()) == false) return false; if (other.getTimeToLiveSpecification() == null ^ this.getTimeToLiveSpecification() == null) return false; if (other.getTimeToLiveSpecification() != null && other.getTimeToLiveSpecification().equals(this.getTimeToLiveSpecification()) == false) return false; return true; }
/** * <p> * Indicates whether Time To Live is to be enabled (true) or disabled (false) on the table. * </p> * * @param enabled * Indicates whether Time To Live is to be enabled (true) or disabled (false) on the table. * @return Returns a reference to this object so that method calls can be chained together. */ public TimeToLiveSpecification withEnabled(Boolean enabled) { setEnabled(enabled); return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof TimeToLiveSpecification == false) return false; TimeToLiveSpecification other = (TimeToLiveSpecification) obj; if (other.getEnabled() == null ^ this.getEnabled() == null) return false; if (other.getEnabled() != null && other.getEnabled().equals(this.getEnabled()) == false) return false; if (other.getAttributeName() == null ^ this.getAttributeName() == null) return false; if (other.getAttributeName() != null && other.getAttributeName().equals(this.getAttributeName()) == false) return false; return true; }
public TimeToLiveSpecification unmarshall(JsonUnmarshallerContext context) throws Exception { TimeToLiveSpecification timeToLiveSpecification = new TimeToLiveSpecification(); if (context.testExpression("Enabled", targetDepth)) { context.nextToken(); timeToLiveSpecification.setEnabled(context.getUnmarshaller(Boolean.class).unmarshall(context)); timeToLiveSpecification.setAttributeName(context.getUnmarshaller(String.class).unmarshall(context));
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTableName() == null) ? 0 : getTableName().hashCode()); hashCode = prime * hashCode + ((getTimeToLiveSpecification() == null) ? 0 : getTimeToLiveSpecification().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UpdateTimeToLiveResult == false) return false; UpdateTimeToLiveResult other = (UpdateTimeToLiveResult) obj; if (other.getTimeToLiveSpecification() == null ^ this.getTimeToLiveSpecification() == null) return false; if (other.getTimeToLiveSpecification() != null && other.getTimeToLiveSpecification().equals(this.getTimeToLiveSpecification()) == false) return false; return true; } }
/** * <p> * The name of the Time to Live attribute used to store the expiration time for items in the table. * </p> * * @param attributeName * The name of the Time to Live attribute used to store the expiration time for items in the table. * @return Returns a reference to this object so that method calls can be chained together. */ public TimeToLiveSpecification withAttributeName(String attributeName) { setAttributeName(attributeName); return this; }
/** * 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 (getEnabled() != null) sb.append("Enabled: ").append(getEnabled()).append(","); if (getAttributeName() != null) sb.append("AttributeName: ").append(getAttributeName()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTimeToLiveSpecification() == null) ? 0 : getTimeToLiveSpecification() .hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UpdateTimeToLiveRequest == false) return false; UpdateTimeToLiveRequest other = (UpdateTimeToLiveRequest) obj; if (other.getTableName() == null ^ this.getTableName() == null) return false; if (other.getTableName() != null && other.getTableName().equals(this.getTableName()) == false) return false; if (other.getTimeToLiveSpecification() == null ^ this.getTimeToLiveSpecification() == null) return false; if (other.getTimeToLiveSpecification() != null && other.getTimeToLiveSpecification().equals(this.getTimeToLiveSpecification()) == false) return false; return true; } }
/** * Marshall the given parameter object. */ public void marshall(TimeToLiveSpecification timeToLiveSpecification, ProtocolMarshaller protocolMarshaller) { if (timeToLiveSpecification == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(timeToLiveSpecification.getEnabled(), ENABLED_BINDING); protocolMarshaller.marshall(timeToLiveSpecification.getAttributeName(), ATTRIBUTENAME_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }