1 /**
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20 package org.apache.wss4j.common.saml.bean;
21
22 import java.util.ArrayList;
23 import java.util.List;
24
25 /**
26 * Class AudienceRestrictionBean represents a SAML AudienceRestriction object
27 */
28 public class AudienceRestrictionBean {
29 private final List<String> audienceURIs = new ArrayList<>();
30
31 /**
32 * Constructor AudienceRestrictionBean creates a new AudienceRestrictionBean instance.
33 */
34 public AudienceRestrictionBean() {
35 }
36
37 /**
38 * Constructor AudienceRestrictionBean creates a new AudienceRestrictionBean instance.
39 *
40 * @param audienceURIs The audienceURI instances
41 */
42 public AudienceRestrictionBean(
43 List<String> audienceURIs
44 ) {
45 if (audienceURIs != null) {
46 this.audienceURIs.addAll(audienceURIs);
47 }
48 }
49
50 /**
51 * Get the audienceURI instances
52 *
53 * @return the audienceURI instances
54 */
55 public List<String> getAudienceURIs() {
56 return audienceURIs;
57 }
58
59 /**
60 * Set the audienceURI instance
61 *
62 * @param audienceURIs the audienceURI instances to set
63 */
64 public void setAudienceURIs(List<String> audienceURIs) {
65 this.audienceURIs.clear();
66 this.audienceURIs.addAll(audienceURIs);
67 }
68
69 /**
70 * Method equals ...
71 *
72 * @param o of type Object
73 * @return boolean
74 */
75 @Override
76 public boolean equals(Object o) {
77 if (this == o) {
78 return true;
79 }
80 if (!(o instanceof AudienceRestrictionBean)) {
81 return false;
82 }
83
84 AudienceRestrictionBean that = (AudienceRestrictionBean) o;
85
86 return audienceURIs.equals(that.audienceURIs);
87 }
88
89 /**
90 * @return the hashcode of this object
91 */
92 @Override
93 public int hashCode() {
94 int result = 17;
95 result = 31 * result + audienceURIs.hashCode();
96 return result;
97 }
98
99 }