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.to;
20  
21  import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
22  import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
23  import java.io.Serializable;
24  import java.util.ArrayList;
25  import java.util.List;
26  import org.apache.commons.lang3.builder.EqualsBuilder;
27  import org.apache.commons.lang3.builder.HashCodeBuilder;
28  
29  public class Provision implements Serializable {
30  
31      private static final long serialVersionUID = 8298910216218007927L;
32  
33      private String anyType;
34  
35      private String objectClass;
36  
37      private final List<String> auxClasses = new ArrayList<>();
38  
39      private String syncToken;
40  
41      private boolean ignoreCaseMatch;
42  
43      private String uidOnCreate;
44  
45      private Mapping mapping;
46  
47      private final List<String> virSchemas = new ArrayList<>();
48  
49      public String getAnyType() {
50          return anyType;
51      }
52  
53      public void setAnyType(final String anyType) {
54          this.anyType = anyType;
55      }
56  
57      public String getObjectClass() {
58          return objectClass;
59      }
60  
61      public void setObjectClass(final String objectClass) {
62          this.objectClass = objectClass;
63      }
64  
65      @JacksonXmlElementWrapper(localName = "auxClasses")
66      @JacksonXmlProperty(localName = "class")
67      public List<String> getAuxClasses() {
68          return auxClasses;
69      }
70  
71      public String getSyncToken() {
72          return syncToken;
73      }
74  
75      public void setSyncToken(final String syncToken) {
76          this.syncToken = syncToken;
77      }
78  
79      public boolean isIgnoreCaseMatch() {
80          return ignoreCaseMatch;
81      }
82  
83      public void setIgnoreCaseMatch(final boolean ignoreCaseMatch) {
84          this.ignoreCaseMatch = ignoreCaseMatch;
85      }
86  
87      public String getUidOnCreate() {
88          return uidOnCreate;
89      }
90  
91      public void setUidOnCreate(final String uidOnCreate) {
92          this.uidOnCreate = uidOnCreate;
93      }
94  
95      public Mapping getMapping() {
96          return mapping;
97      }
98  
99      public void setMapping(final Mapping mapping) {
100         this.mapping = mapping;
101     }
102 
103     @JacksonXmlElementWrapper(localName = "virSchemas")
104     @JacksonXmlProperty(localName = "virSchema")
105     public List<String> getVirSchemas() {
106         return virSchemas;
107     }
108 
109     @Override
110     public boolean equals(final Object obj) {
111         if (this == obj) {
112             return true;
113         }
114         if (obj == null) {
115             return false;
116         }
117         if (getClass() != obj.getClass()) {
118             return false;
119         }
120         Provision other = (Provision) obj;
121         return new EqualsBuilder().
122                 append(ignoreCaseMatch, other.ignoreCaseMatch).
123                 append(anyType, other.anyType).
124                 append(objectClass, other.objectClass).
125                 append(auxClasses, other.auxClasses).
126                 append(syncToken, other.syncToken).
127                 append(uidOnCreate, other.uidOnCreate).
128                 append(mapping, other.mapping).
129                 append(virSchemas, other.virSchemas).
130                 build();
131     }
132 
133     @Override
134     public int hashCode() {
135         return new HashCodeBuilder().
136                 append(anyType).
137                 append(objectClass).
138                 append(auxClasses).
139                 append(syncToken).
140                 append(ignoreCaseMatch).
141                 append(uidOnCreate).
142                 append(mapping).
143                 append(virSchemas).
144                 build();
145     }
146 }