@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getKeys() == null) ? 0 : getKeys().hashCode()); hashCode = prime * hashCode + ((getNextMarker() == null) ? 0 : getNextMarker().hashCode()); hashCode = prime * hashCode + ((getTruncated() == null) ? 0 : getTruncated().hashCode()); return hashCode; }
public ListKeysResult unmarshall(JsonUnmarshallerContext context) throws Exception { ListKeysResult listKeysResult = new ListKeysResult(); if (context.testExpression("Keys", targetDepth)) { context.nextToken(); listKeysResult.setKeys(new ListUnmarshaller<KeyListEntry>(KeyListEntryJsonUnmarshaller.getInstance()).unmarshall(context)); listKeysResult.setNextMarker(context.getUnmarshaller(String.class).unmarshall(context)); listKeysResult.setTruncated(context.getUnmarshaller(Boolean.class).unmarshall(context));
/** * <p> * A list of customer master keys (CMKs). * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param keys <p> * A list of customer master keys (CMKs). * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public ListKeysResult withKeys(KeyListEntry... keys) { if (getKeys() == null) { this.keys = new java.util.ArrayList<KeyListEntry>(keys.length); } for (KeyListEntry value : keys) { this.keys.add(value); } return this; }
/** * <p> * A list of customer master keys (CMKs). * </p> * * @param keys * A list of customer master keys (CMKs). * @return Returns a reference to this object so that method calls can be chained together. */ public ListKeysResult withKeys(java.util.Collection<KeyListEntry> keys) { setKeys(keys); return this; }
/** * <p> * When <code>Truncated</code> is true, this element is present and contains the value to use for the * <code>Marker</code> parameter in a subsequent request. * </p> * * @param nextMarker * When <code>Truncated</code> is true, this element is present and contains the value to use for the * <code>Marker</code> parameter in a subsequent request. * @return Returns a reference to this object so that method calls can be chained together. */ public ListKeysResult withNextMarker(String nextMarker) { setNextMarker(nextMarker); return this; }
/** * <p> * A flag that indicates whether there are more items in the list. When this value is true, the list in this * response is truncated. To get more items, pass the value of the <code>NextMarker</code> element in this response * to the <code>Marker</code> parameter in a subsequent request. * </p> * * @param truncated * A flag that indicates whether there are more items in the list. When this value is true, the list in this * response is truncated. To get more items, pass the value of the <code>NextMarker</code> element in this * response to the <code>Marker</code> parameter in a subsequent request. * @return Returns a reference to this object so that method calls can be chained together. */ public ListKeysResult withTruncated(Boolean truncated) { setTruncated(truncated); return this; }
/** * <p> * A list of keys. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param keys <p> * A list of keys. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public ListKeysResult withKeys(KeyListEntry... keys) { if (getKeys() == null) { this.keys = new java.util.ArrayList<KeyListEntry>(keys.length); } for (KeyListEntry value : keys) { this.keys.add(value); } return this; }
/** * <p> * A list of customer master keys (CMKs). * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setKeys(java.util.Collection)} or {@link #withKeys(java.util.Collection)} if you want to override the * existing values. * </p> * * @param keys * A list of customer master keys (CMKs). * @return Returns a reference to this object so that method calls can be chained together. */ public ListKeysResult withKeys(KeyListEntry... keys) { if (this.keys == null) { setKeys(new com.amazonaws.internal.SdkInternalList<KeyListEntry>(keys.length)); } for (KeyListEntry ele : keys) { this.keys.add(ele); } return this; }
/** * <p> * When <code>Truncated</code> is true, this element is present and contains the value to use for the * <code>Marker</code> parameter in a subsequent request. * </p> * * @param nextMarker * When <code>Truncated</code> is true, this element is present and contains the value to use for the * <code>Marker</code> parameter in a subsequent request. * @return Returns a reference to this object so that method calls can be chained together. */ public ListKeysResult withNextMarker(String nextMarker) { setNextMarker(nextMarker); return this; }
/** * <p> * A flag that indicates whether there are more items in the list. When this value is true, the list in this * response is truncated. To get more items, pass the value of the <code>NextMarker</code> element in this response * to the <code>Marker</code> parameter in a subsequent request. * </p> * * @param truncated * A flag that indicates whether there are more items in the list. When this value is true, the list in this * response is truncated. To get more items, pass the value of the <code>NextMarker</code> element in this * response to the <code>Marker</code> parameter in a subsequent request. * @return Returns a reference to this object so that method calls can be chained together. */ public ListKeysResult withTruncated(Boolean truncated) { setTruncated(truncated); return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ListKeysResult == false) return false; ListKeysResult other = (ListKeysResult) obj; if (other.getKeys() == null ^ this.getKeys() == null) return false; if (other.getKeys() != null && other.getKeys().equals(this.getKeys()) == false) return false; if (other.getNextMarker() == null ^ this.getNextMarker() == null) return false; if (other.getNextMarker() != null && other.getNextMarker().equals(this.getNextMarker()) == false) return false; if (other.getTruncated() == null ^ this.getTruncated() == null) return false; if (other.getTruncated() != null && other.getTruncated().equals(this.getTruncated()) == false) return false; return true; }
public ListKeysResult unmarshall(JsonUnmarshallerContext context) throws Exception { ListKeysResult listKeysResult = new ListKeysResult(); AwsJsonReader reader = context.getReader(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("Keys")) { listKeysResult.setKeys(new ListUnmarshaller<KeyListEntry>( KeyListEntryJsonUnmarshaller.getInstance() ) .unmarshall(context)); } else if (name.equals("NextMarker")) { listKeysResult.setNextMarker(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("Truncated")) { listKeysResult.setTruncated(BooleanJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return listKeysResult; }
/** * <p> * A list of customer master keys (CMKs). * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param keys <p> * A list of customer master keys (CMKs). * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public ListKeysResult withKeys(KeyListEntry... keys) { if (getKeys() == null) { this.keys = new java.util.ArrayList<KeyListEntry>(keys.length); } for (KeyListEntry value : keys) { this.keys.add(value); } return this; }
/** * <p> * A list of customer master keys (CMKs). * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param keys <p> * A list of customer master keys (CMKs). * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public ListKeysResult withKeys(java.util.Collection<KeyListEntry> keys) { setKeys(keys); return this; }
/** * <p> * When <code>Truncated</code> is true, this element is present and contains the value to use for the * <code>Marker</code> parameter in a subsequent request. * </p> * * @param nextMarker * When <code>Truncated</code> is true, this element is present and contains the value to use for the * <code>Marker</code> parameter in a subsequent request. * @return Returns a reference to this object so that method calls can be chained together. */ public ListKeysResult withNextMarker(String nextMarker) { setNextMarker(nextMarker); return this; }
/** * <p> * A flag that indicates whether there are more items in the list. When this value is true, the list in this * response is truncated. To get more items, pass the value of the <code>NextMarker</code> element in this response * to the <code>Marker</code> parameter in a subsequent request. * </p> * * @param truncated * A flag that indicates whether there are more items in the list. When this value is true, the list in this * response is truncated. To get more items, pass the value of the <code>NextMarker</code> element in this * response to the <code>Marker</code> parameter in a subsequent request. * @return Returns a reference to this object so that method calls can be chained together. */ public ListKeysResult withTruncated(Boolean truncated) { setTruncated(truncated); 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 (getKeys() != null) sb.append("Keys: ").append(getKeys()).append(","); if (getNextMarker() != null) sb.append("NextMarker: ").append(getNextMarker()).append(","); if (getTruncated() != null) sb.append("Truncated: ").append(getTruncated()); sb.append("}"); return sb.toString(); }
public ListKeysResult unmarshall(JsonUnmarshallerContext context) throws Exception { ListKeysResult listKeysResult = new ListKeysResult(); AwsJsonReader reader = context.getReader(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("Keys")) { listKeysResult.setKeys(new ListUnmarshaller<KeyListEntry>( KeyListEntryJsonUnmarshaller.getInstance() ) .unmarshall(context)); } else if (name.equals("NextMarker")) { listKeysResult.setNextMarker(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("Truncated")) { listKeysResult.setTruncated(BooleanJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return listKeysResult; }
@Override public Set<Algorithm> call() throws BackgroundException { final AWSKMS client = client(container); try { final Map<String, String> aliases = new HashMap<String, String>(); for(AliasListEntry entry : client.listAliases().getAliases()) { aliases.put(entry.getTargetKeyId(), entry.getAliasName()); } final Set<Algorithm> keys = new HashSet<Algorithm>(); for(KeyListEntry entry : client.listKeys().getKeys()) { keys.add(new AliasedAlgorithm(entry, aliases.get(entry.getKeyId()))); } return keys; } catch(AmazonClientException e) { throw new AmazonServiceExceptionMappingService().map("Cannot read AWS KMS configuration", e); } finally { client.shutdown(); } } }, prompt));
/** * <p> * A list of customer master keys (CMKs). * </p> * * @param keys * A list of customer master keys (CMKs). * @return Returns a reference to this object so that method calls can be chained together. */ public ListKeysResult withKeys(java.util.Collection<KeyListEntry> keys) { setKeys(keys); return this; }