/** * Constructor ProxyRestrictionBean creates a new ProxyRestrictionBean instance. * * @param count The count instance * @param audienceURIs The audienceURI instances */ public ProxyRestrictionBean( int count, List<String> audienceURIs ) { this.setCount(count); if (audienceURIs != null) { this.audienceURIs.addAll(audienceURIs); } }
/** * Create a ProxyRestriction object * * @return a ProxyRestriction object */ @SuppressWarnings("unchecked") public static ProxyRestriction createProxyRestriction(ProxyRestrictionBean proxyRestrictionBean) { if (proxyRestrictionBuilder == null) { proxyRestrictionBuilder = (SAMLObjectBuilder<ProxyRestriction>) builderFactory.getBuilder(ProxyRestriction.DEFAULT_ELEMENT_NAME); } ProxyRestriction proxyRestriction = proxyRestrictionBuilder.buildObject(); if (proxyRestrictionBean.getCount() > 0) { proxyRestriction.setProxyCount(proxyRestrictionBean.getCount()); } if (!proxyRestrictionBean.getAudienceURIs().isEmpty()) { if (audienceBuilder == null) { audienceBuilder = (SAMLObjectBuilder<Audience>) builderFactory.getBuilder(Audience.DEFAULT_ELEMENT_NAME); } for (String audienceURI : proxyRestrictionBean.getAudienceURIs()) { Audience audience = audienceBuilder.buildObject(); audience.setAudienceURI(audienceURI); proxyRestriction.getAudiences().add(audience); } } return proxyRestriction; }
return false; } else if (proxyRestriction != null && !proxyRestriction.equals(that.proxyRestriction)) { return false;
/** * @return the hashcode of this object */ @Override public int hashCode() { int result = (int)tokenPeriodSeconds; if (notBefore != null) { result = 31 * result + notBefore.hashCode(); } if (notAfter != null) { result = 31 * result + notAfter.hashCode(); } if (audienceRestrictions != null) { result = 31 * result + audienceRestrictions.hashCode(); } result = 31 * result + (oneTimeUse ? 1 : 0); if (proxyRestriction != null) { result = 31 * result + proxyRestriction.hashCode(); } if (delegates != null) { result = 31 * result + delegates.hashCode(); } return result; }