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  package org.apache.syncope.common.lib.types;
20  
21  import org.apache.commons.lang3.builder.EqualsBuilder;
22  import org.apache.commons.lang3.builder.HashCodeBuilder;
23  import org.apache.syncope.common.lib.BaseBean;
24  
25  public class SRARouteFilter implements BaseBean {
26  
27      private static final long serialVersionUID = -635785645207375128L;
28  
29      public static class Builder {
30  
31          private final SRARouteFilter instance = new SRARouteFilter();
32  
33          public Builder factory(final SRARouteFilterFactory factory) {
34              instance.setFactory(factory);
35              return this;
36          }
37  
38          public Builder args(final String args) {
39              instance.setArgs(args);
40              return this;
41          }
42  
43          public SRARouteFilter build() {
44              return instance;
45          }
46      }
47  
48      private SRARouteFilterFactory factory;
49  
50      private String args;
51  
52      public SRARouteFilterFactory getFactory() {
53          return factory;
54      }
55  
56      public void setFactory(final SRARouteFilterFactory factory) {
57          this.factory = factory;
58      }
59  
60      public String getArgs() {
61          return args;
62      }
63  
64      public void setArgs(final String args) {
65          this.args = args;
66      }
67  
68      @Override
69      public int hashCode() {
70          return new HashCodeBuilder().
71                  append(factory).
72                  append(args).
73                  build();
74      }
75  
76      @Override
77      public boolean equals(final Object obj) {
78          if (this == obj) {
79              return true;
80          }
81          if (obj == null) {
82              return false;
83          }
84          if (getClass() != obj.getClass()) {
85              return false;
86          }
87          final SRARouteFilter other = (SRARouteFilter) obj;
88          return new EqualsBuilder().
89                  append(factory, other.factory).
90                  append(args, other.args).
91                  build();
92      }
93  
94      @Override
95      public String toString() {
96          return "GatewayFilter{"
97                  + "factory=" + factory
98                  + ", args=" + args
99                  + '}';
100     }
101 }