View Javadoc
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 ProxyRestrictionBean represents a SAML 2.0 ProxyRestrictionBean object
27   */
28  public class ProxyRestrictionBean {
29      private int count;
30      private final List<String> audienceURIs = new ArrayList<>();
31  
32      /**
33       * Constructor ProxyRestrictionBean creates a new ProxyRestrictionBean instance.
34       */
35      public ProxyRestrictionBean() {
36      }
37  
38      /**
39       * Constructor ProxyRestrictionBean creates a new ProxyRestrictionBean instance.
40       *
41       * @param count The count instance
42       * @param audienceURIs The audienceURI instances
43       */
44      public ProxyRestrictionBean(
45          int count,
46          List<String> audienceURIs
47      ) {
48          this.setCount(count);
49          if (audienceURIs != null) {
50              this.audienceURIs.addAll(audienceURIs);
51          }
52      }
53  
54      /**
55       * Get the audienceURI instances
56       *
57       * @return the audienceURI instances
58       */
59      public List<String> getAudienceURIs() {
60          return audienceURIs;
61      }
62  
63      public int getCount() {
64          return count;
65      }
66  
67      public void setCount(int count) {
68          this.count = count;
69      }
70  
71      /**
72       * Method equals ...
73       *
74       * @param o of type Object
75       * @return boolean
76       */
77      @Override
78      public boolean equals(Object o) {
79          if (this == o) {
80              return true;
81          }
82          if (!(o instanceof ProxyRestrictionBean)) {
83              return false;
84          }
85  
86          ProxyRestrictionBean that = (ProxyRestrictionBean) o;
87  
88          if (count != that.count) {
89              return false;
90          }
91  
92          return audienceURIs.equals(that.audienceURIs);
93      }
94  
95      /**
96       * @return the hashcode of this object
97       */
98      @Override
99      public int hashCode() {
100         int result = count;
101         result = 31 * result + audienceURIs.hashCode();
102         return result;
103     }
104 
105 }