public ExplicitDeny unmarshall(JsonUnmarshallerContext context) throws Exception { ExplicitDeny explicitDeny = new ExplicitDeny(); 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("policies", targetDepth)) { context.nextToken(); explicitDeny.setPolicies(new ListUnmarshaller<Policy>(PolicyJsonUnmarshaller.getInstance()).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 explicitDeny; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPolicies() == null) ? 0 : getPolicies().hashCode()); return hashCode; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getImplicitDeny() == null) ? 0 : getImplicitDeny().hashCode()); hashCode = prime * hashCode + ((getExplicitDeny() == null) ? 0 : getExplicitDeny().hashCode()); return hashCode; }
/** * <p> * The policies that denied the authorization. * </p> * * @param policies * The policies that denied the authorization. * @return Returns a reference to this object so that method calls can be chained together. */ public ExplicitDeny withPolicies(java.util.Collection<Policy> policies) { setPolicies(policies); return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Denied == false) return false; Denied other = (Denied) obj; if (other.getImplicitDeny() == null ^ this.getImplicitDeny() == null) return false; if (other.getImplicitDeny() != null && other.getImplicitDeny().equals(this.getImplicitDeny()) == false) return false; if (other.getExplicitDeny() == null ^ this.getExplicitDeny() == null) return false; if (other.getExplicitDeny() != null && other.getExplicitDeny().equals(this.getExplicitDeny()) == false) return false; return true; }
/** * <p> * The policies that denied the authorization. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setPolicies(java.util.Collection)} or {@link #withPolicies(java.util.Collection)} if you want to override * the existing values. * </p> * * @param policies * The policies that denied the authorization. * @return Returns a reference to this object so that method calls can be chained together. */ public ExplicitDeny withPolicies(Policy... policies) { if (this.policies == null) { setPolicies(new java.util.ArrayList<Policy>(policies.length)); } for (Policy ele : policies) { this.policies.add(ele); } return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Denied == false) return false; Denied other = (Denied) obj; if (other.getImplicitDeny() == null ^ this.getImplicitDeny() == null) return false; if (other.getImplicitDeny() != null && other.getImplicitDeny().equals(this.getImplicitDeny()) == false) return false; if (other.getExplicitDeny() == null ^ this.getExplicitDeny() == null) return false; if (other.getExplicitDeny() != null && other.getExplicitDeny().equals(this.getExplicitDeny()) == false) return false; return true; } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ExplicitDeny == false) return false; ExplicitDeny other = (ExplicitDeny) obj; if (other.getPolicies() == null ^ this.getPolicies() == null) return false; if (other.getPolicies() != null && other.getPolicies().equals(this.getPolicies()) == false) return false; return true; }
public ExplicitDeny unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } ExplicitDeny explicitDeny = new ExplicitDeny(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("policies")) { explicitDeny.setPolicies(new ListUnmarshaller<Policy>(PolicyJsonUnmarshaller .getInstance() ) .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return explicitDeny; }
/** * <p> * The policies that denied the authorization. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param policies <p> * The policies that denied the authorization. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public ExplicitDeny withPolicies(java.util.Collection<Policy> policies) { setPolicies(policies); return this; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getImplicitDeny() == null) ? 0 : getImplicitDeny().hashCode()); hashCode = prime * hashCode + ((getExplicitDeny() == null) ? 0 : getExplicitDeny().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Denied == false) return false; Denied other = (Denied) obj; if (other.getImplicitDeny() == null ^ this.getImplicitDeny() == null) return false; if (other.getImplicitDeny() != null && other.getImplicitDeny().equals(this.getImplicitDeny()) == false) return false; if (other.getExplicitDeny() == null ^ this.getExplicitDeny() == null) return false; if (other.getExplicitDeny() != null && other.getExplicitDeny().equals(this.getExplicitDeny()) == 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 (getPolicies() != null) sb.append("Policies: ").append(getPolicies()); sb.append("}"); return sb.toString(); }
public ExplicitDeny unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } ExplicitDeny explicitDeny = new ExplicitDeny(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("policies")) { explicitDeny.setPolicies(new ListUnmarshaller<Policy>(PolicyJsonUnmarshaller .getInstance() ) .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return explicitDeny; }
/** * <p> * The policies that denied the authorization. * </p> * * @param policies * The policies that denied the authorization. * @return Returns a reference to this object so that method calls can be chained together. */ public ExplicitDeny withPolicies(java.util.Collection<Policy> policies) { setPolicies(policies); return this; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getImplicitDeny() == null) ? 0 : getImplicitDeny().hashCode()); hashCode = prime * hashCode + ((getExplicitDeny() == null) ? 0 : getExplicitDeny().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Denied == false) return false; Denied other = (Denied) obj; if (other.getImplicitDeny() == null ^ this.getImplicitDeny() == null) return false; if (other.getImplicitDeny() != null && other.getImplicitDeny().equals(this.getImplicitDeny()) == false) return false; if (other.getExplicitDeny() == null ^ this.getExplicitDeny() == null) return false; if (other.getExplicitDeny() != null && other.getExplicitDeny().equals(this.getExplicitDeny()) == false) return false; return true; } }
/** * Marshall the given parameter object. */ public void marshall(ExplicitDeny explicitDeny, ProtocolMarshaller protocolMarshaller) { if (explicitDeny == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(explicitDeny.getPolicies(), POLICIES_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
public ExplicitDeny unmarshall(JsonUnmarshallerContext context) throws Exception { ExplicitDeny explicitDeny = new ExplicitDeny(); 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("policies", targetDepth)) { context.nextToken(); explicitDeny.setPolicies(new ListUnmarshaller<Policy>(PolicyJsonUnmarshaller.getInstance()).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 explicitDeny; }
/** * <p> * The policies that denied the authorization. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param policies <p> * The policies that denied the authorization. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public ExplicitDeny withPolicies(java.util.Collection<Policy> policies) { setPolicies(policies); return this; }