/** * Create a clone of the provided claim. * * @param claim Claim to be cloned. Value cannot be null. */ public Claim(Claim claim) { if (claim == null) { throw new IllegalArgumentException("Claim cannot be null"); } claimType = claim.getClaimType(); optional = claim.isOptional(); values.addAll(claim.getValues()); }
/** * Create a clone of the provided claim. * * @param claim Claim to be cloned. Value cannot be null. */ public Claim(Claim claim) { if (claim == null) { throw new IllegalArgumentException("Claim cannot be null"); } claimType = claim.getClaimType(); optional = claim.isOptional(); values.addAll(claim.getValues()); }
private boolean validateClaimValues(ClaimCollection requestedClaims, ProcessedClaimCollection claims) { for (Claim claim : requestedClaims) { String claimType = claim.getClaimType(); boolean found = false; if (!claim.isOptional()) { for (ProcessedClaim c : claims) { if (c.getClaimType().equals(claimType)) { found = true; break; } } if (!found) { LOG.warning("Mandatory claim not found: " + claim.getClaimType()); throw new STSException("Mandatory claim '" + claim.getClaimType() + "' not found"); } } } return true; }
private boolean validateClaimValues(ClaimCollection requestedClaims, ProcessedClaimCollection claims) { for (Claim claim : requestedClaims) { String claimType = claim.getClaimType(); boolean found = false; if (!claim.isOptional()) { for (ProcessedClaim c : claims) { if (c.getClaimType().equals(claimType)) { found = true; break; } } if (!found) { LOG.warning("Mandatory claim not found: " + claim.getClaimType()); throw new STSException("Mandatory claim '" + claim.getClaimType() + "' not found"); } } } return true; }