@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetPolicyResult == false) return false; GetPolicyResult other = (GetPolicyResult) obj; if (other.getPolicy() == null ^ this.getPolicy() == null) return false; if (other.getPolicy() != null && other.getPolicy().equals(this.getPolicy()) == false) return false; return true; }
/** * <p> * A structure containing details about the policy. * </p> * * @param policy * A structure containing details about the policy. * @return Returns a reference to this object so that method calls can be chained together. */ public GetPolicyResult withPolicy(Policy policy) { setPolicy(policy); return this; }
public GetPolicyResult unmarshall(StaxUnmarshallerContext context) throws Exception { GetPolicyResult getPolicyResult = new GetPolicyResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return getPolicyResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Policy", targetDepth)) { getPolicyResult.setPolicy(PolicyStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return getPolicyResult; } } } }
public GetPolicyResult unmarshall(StaxUnmarshallerContext context) throws Exception { GetPolicyResult getPolicyResult = new GetPolicyResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return getPolicyResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Policy", targetDepth)) { getPolicyResult.setPolicy(PolicyStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return getPolicyResult; } } } }
/** * <p> * A structure containing details about the policy. * </p> * * @param policy * A structure containing details about the policy. * @return Returns a reference to this object so that method calls can be chained together. */ public GetPolicyResult withPolicy(Policy policy) { setPolicy(policy); 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 (getPolicy() != null) sb.append("Policy: ").append(getPolicy()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetPolicyResult == false) return false; GetPolicyResult other = (GetPolicyResult) obj; if (other.getPolicy() == null ^ this.getPolicy() == null) return false; if (other.getPolicy() != null && other.getPolicy().equals(this.getPolicy()) == 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 (getPolicy() != null) sb.append("Policy: ").append(getPolicy()); sb.append("}"); return sb.toString(); }
policyRequest.setPolicyArn(policy.getPolicyArn()); GetPolicyResult policyResult = iamClient.getPolicy(policyRequest); Policy p = policyResult.getPolicy();
.withVersionId(getResult.getPolicy().getDefaultVersionId())) .getPolicyVersion();