/** * Deletes this global secondary index (GSI) from the DynamoDB table. * Involves network calls. * <p> * This index must be a global secondary index and in the * <code>ACTIVE</code> state for this operation to succeed. Deleting a GSI * is an asynchronous operation; while executing the operation, the index is * in the <code>DELETING</code> state. * * @return the updated table description returned from DynamoDB. */ public TableDescription deleteGSI() { return table.updateTable(new UpdateTableSpec() .withGlobalSecondaryIndexUpdates( new GlobalSecondaryIndexUpdate().withDelete( new DeleteGlobalSecondaryIndexAction() .withIndexName(indexName)))); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DeleteGlobalSecondaryIndexAction == false) return false; DeleteGlobalSecondaryIndexAction other = (DeleteGlobalSecondaryIndexAction) obj; if (other.getIndexName() == null ^ this.getIndexName() == null) return false; if (other.getIndexName() != null && other.getIndexName().equals(this.getIndexName()) == false) return false; return true; }
/** * <p> * The name of the global secondary index to be deleted. * </p> * * @param indexName * The name of the global secondary index to be deleted. * @return Returns a reference to this object so that method calls can be chained together. */ public DeleteGlobalSecondaryIndexAction withIndexName(String indexName) { setIndexName(indexName); return this; }
public DeleteGlobalSecondaryIndexAction unmarshall(JsonUnmarshallerContext context) throws Exception { DeleteGlobalSecondaryIndexAction deleteGlobalSecondaryIndexAction = new DeleteGlobalSecondaryIndexAction(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) { return null; } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("IndexName", targetDepth)) { context.nextToken(); deleteGlobalSecondaryIndexAction.setIndexName(context.getUnmarshaller(String.class).unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return deleteGlobalSecondaryIndexAction; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getUpdate() == null) ? 0 : getUpdate().hashCode()); hashCode = prime * hashCode + ((getCreate() == null) ? 0 : getCreate().hashCode()); hashCode = prime * hashCode + ((getDelete() == null) ? 0 : getDelete().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GlobalSecondaryIndexUpdate == false) return false; GlobalSecondaryIndexUpdate other = (GlobalSecondaryIndexUpdate) obj; if (other.getUpdate() == null ^ this.getUpdate() == null) return false; if (other.getUpdate() != null && other.getUpdate().equals(this.getUpdate()) == false) return false; if (other.getCreate() == null ^ this.getCreate() == null) return false; if (other.getCreate() != null && other.getCreate().equals(this.getCreate()) == false) return false; if (other.getDelete() == null ^ this.getDelete() == null) return false; if (other.getDelete() != null && other.getDelete().equals(this.getDelete()) == false) return false; return true; }
public DeleteGlobalSecondaryIndexAction unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } DeleteGlobalSecondaryIndexAction deleteGlobalSecondaryIndexAction = new DeleteGlobalSecondaryIndexAction(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("IndexName")) { deleteGlobalSecondaryIndexAction.setIndexName(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return deleteGlobalSecondaryIndexAction; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getUpdate() == null) ? 0 : getUpdate().hashCode()); hashCode = prime * hashCode + ((getCreate() == null) ? 0 : getCreate().hashCode()); hashCode = prime * hashCode + ((getDelete() == null) ? 0 : getDelete().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GlobalSecondaryIndexUpdate == false) return false; GlobalSecondaryIndexUpdate other = (GlobalSecondaryIndexUpdate) obj; if (other.getUpdate() == null ^ this.getUpdate() == null) return false; if (other.getUpdate() != null && other.getUpdate().equals(this.getUpdate()) == false) return false; if (other.getCreate() == null ^ this.getCreate() == null) return false; if (other.getCreate() != null && other.getCreate().equals(this.getCreate()) == false) return false; if (other.getDelete() == null ^ this.getDelete() == null) return false; if (other.getDelete() != null && other.getDelete().equals(this.getDelete()) == false) return false; return true; } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getIndexName() == null) ? 0 : getIndexName().hashCode()); return hashCode; }
public DeleteGlobalSecondaryIndexAction unmarshall(JsonUnmarshallerContext context) throws Exception { DeleteGlobalSecondaryIndexAction deleteGlobalSecondaryIndexAction = new DeleteGlobalSecondaryIndexAction(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) { return null; } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("IndexName", targetDepth)) { context.nextToken(); deleteGlobalSecondaryIndexAction.setIndexName(context.getUnmarshaller(String.class).unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return deleteGlobalSecondaryIndexAction; }
/** * Deletes this global secondary index (GSI) from the DynamoDB table. * Involves network calls. * <p> * This index must be a global secondary index and in the * <code>ACTIVE</code> state for this operation to succeed. Deleting a GSI * is an asynchronous operation; while executing the operation, the index is * in the <code>DELETING</code> state. * * @return the updated table description returned from DynamoDB. */ public TableDescription deleteGSI() { return table.updateTable(new UpdateTableSpec() .withGlobalSecondaryIndexUpdates( new GlobalSecondaryIndexUpdate().withDelete( new DeleteGlobalSecondaryIndexAction() .withIndexName(indexName)))); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getUpdate() == null) ? 0 : getUpdate().hashCode()); hashCode = prime * hashCode + ((getCreate() == null) ? 0 : getCreate().hashCode()); hashCode = prime * hashCode + ((getDelete() == null) ? 0 : getDelete().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GlobalSecondaryIndexUpdate == false) return false; GlobalSecondaryIndexUpdate other = (GlobalSecondaryIndexUpdate) obj; if (other.getUpdate() == null ^ this.getUpdate() == null) return false; if (other.getUpdate() != null && other.getUpdate().equals(this.getUpdate()) == false) return false; if (other.getCreate() == null ^ this.getCreate() == null) return false; if (other.getCreate() != null && other.getCreate().equals(this.getCreate()) == false) return false; if (other.getDelete() == null ^ this.getDelete() == null) return false; if (other.getDelete() != null && other.getDelete().equals(this.getDelete()) == false) return false; return true; }
/** * <p> * The name of the global secondary index to be deleted. * </p> * * @param indexName * The name of the global secondary index to be deleted. * @return Returns a reference to this object so that method calls can be chained together. */ public DeleteGlobalSecondaryIndexAction withIndexName(String indexName) { setIndexName(indexName); 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 (getIndexName() != null) sb.append("IndexName: ").append(getIndexName()); sb.append("}"); return sb.toString(); }
/** * Marshall the given parameter object. */ public void marshall(DeleteGlobalSecondaryIndexAction deleteGlobalSecondaryIndexAction, ProtocolMarshaller protocolMarshaller) { if (deleteGlobalSecondaryIndexAction == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(deleteGlobalSecondaryIndexAction.getIndexName(), INDEXNAME_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getIndexName() == null) ? 0 : getIndexName().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DeleteGlobalSecondaryIndexAction == false) return false; DeleteGlobalSecondaryIndexAction other = (DeleteGlobalSecondaryIndexAction) obj; if (other.getIndexName() == null ^ this.getIndexName() == null) return false; if (other.getIndexName() != null && other.getIndexName().equals(this.getIndexName()) == false) return false; return true; } }
/** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getIndexName() != null) sb.append("IndexName: " + getIndexName()); sb.append("}"); return sb.toString(); }