@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAliases() == null) ? 0 : getAliases().hashCode()); hashCode = prime * hashCode + ((getNextMarker() == null) ? 0 : getNextMarker().hashCode()); hashCode = prime * hashCode + ((getTruncated() == null) ? 0 : getTruncated().hashCode()); return hashCode; }
public ListAliasesResult unmarshall(JsonUnmarshallerContext context) throws Exception { ListAliasesResult listAliasesResult = new ListAliasesResult(); if (context.testExpression("Aliases", targetDepth)) { context.nextToken(); listAliasesResult.setAliases(new ListUnmarshaller<AliasListEntry>(AliasListEntryJsonUnmarshaller.getInstance()).unmarshall(context)); listAliasesResult.setNextMarker(context.getUnmarshaller(String.class).unmarshall(context)); listAliasesResult.setTruncated(context.getUnmarshaller(Boolean.class).unmarshall(context));
/** * <p> * A list of aliases. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param aliases <p> * A list of aliases. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public ListAliasesResult withAliases(AliasListEntry... aliases) { if (getAliases() == null) { this.aliases = new java.util.ArrayList<AliasListEntry>(aliases.length); } for (AliasListEntry value : aliases) { this.aliases.add(value); } return this; }
/** * <p> * A list of aliases. * </p> * * @param aliases * A list of aliases. * @return Returns a reference to this object so that method calls can be chained together. */ public ListAliasesResult withAliases(java.util.Collection<AliasListEntry> aliases) { setAliases(aliases); 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 ListAliasesResult 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 ListAliasesResult withTruncated(Boolean truncated) { setTruncated(truncated); return this; }
/** * <p> * A list of aliases. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param aliases <p> * A list of aliases. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public ListAliasesResult withAliases(AliasListEntry... aliases) { if (getAliases() == null) { this.aliases = new java.util.ArrayList<AliasListEntry>(aliases.length); } for (AliasListEntry value : aliases) { this.aliases.add(value); } return this; }
/** * <p> * A list of aliases. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setAliases(java.util.Collection)} or {@link #withAliases(java.util.Collection)} if you want to override * the existing values. * </p> * * @param aliases * A list of aliases. * @return Returns a reference to this object so that method calls can be chained together. */ public ListAliasesResult withAliases(AliasListEntry... aliases) { if (this.aliases == null) { setAliases(new com.amazonaws.internal.SdkInternalList<AliasListEntry>(aliases.length)); } for (AliasListEntry ele : aliases) { this.aliases.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 ListAliasesResult 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 ListAliasesResult 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 ListAliasesResult == false) return false; ListAliasesResult other = (ListAliasesResult) obj; if (other.getAliases() == null ^ this.getAliases() == null) return false; if (other.getAliases() != null && other.getAliases().equals(this.getAliases()) == 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 ListAliasesResult unmarshall(JsonUnmarshallerContext context) throws Exception { ListAliasesResult listAliasesResult = new ListAliasesResult(); AwsJsonReader reader = context.getReader(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("Aliases")) { listAliasesResult.setAliases(new ListUnmarshaller<AliasListEntry>( AliasListEntryJsonUnmarshaller.getInstance() ) .unmarshall(context)); } else if (name.equals("NextMarker")) { listAliasesResult.setNextMarker(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("Truncated")) { listAliasesResult.setTruncated(BooleanJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return listAliasesResult; }
/** * <p> * A list of key aliases in the user's account. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param aliases <p> * A list of key aliases in the user's account. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public ListAliasesResult withAliases(AliasListEntry... aliases) { if (getAliases() == null) { this.aliases = new java.util.ArrayList<AliasListEntry>(aliases.length); } for (AliasListEntry value : aliases) { this.aliases.add(value); } return this; }
/** * <p> * A list of aliases. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param aliases <p> * A list of aliases. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public ListAliasesResult withAliases(java.util.Collection<AliasListEntry> aliases) { setAliases(aliases); 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 ListAliasesResult 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 ListAliasesResult 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 (getAliases() != null) sb.append("Aliases: ").append(getAliases()).append(","); if (getNextMarker() != null) sb.append("NextMarker: ").append(getNextMarker()).append(","); if (getTruncated() != null) sb.append("Truncated: ").append(getTruncated()); sb.append("}"); return sb.toString(); }
public ListAliasesResult unmarshall(JsonUnmarshallerContext context) throws Exception { ListAliasesResult listAliasesResult = new ListAliasesResult(); AwsJsonReader reader = context.getReader(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("Aliases")) { listAliasesResult.setAliases(new ListUnmarshaller<AliasListEntry>( AliasListEntryJsonUnmarshaller.getInstance() ) .unmarshall(context)); } else if (name.equals("NextMarker")) { listAliasesResult.setNextMarker(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("Truncated")) { listAliasesResult.setTruncated(BooleanJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return listAliasesResult; }
@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 aliases. * </p> * * @param aliases * A list of aliases. * @return Returns a reference to this object so that method calls can be chained together. */ public ListAliasesResult withAliases(java.util.Collection<AliasListEntry> aliases) { setAliases(aliases); return this; }