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.myfaces.cdi.converter;
21  
22  import java.io.Serializable;
23  import java.lang.reflect.Type;
24  import java.util.Objects;
25  
26  /**
27   *
28   */
29  public class FacesConverterInfo implements Serializable
30  {
31      private Type type;
32      
33      private Class forClass;
34      
35      private String converterId;
36  
37      public FacesConverterInfo(Type type, Class forClass, String converterId)
38      {
39          this.type = type;
40          this.forClass = forClass;
41          this.converterId = converterId;
42      }
43  
44      /**
45       * @return the converterId
46       */
47      public String getConverterId()
48      {
49          return converterId;
50      }
51  
52      /**
53       * @param converterId the converterId to set
54       */
55      public void setConverterId(String converterId)
56      {
57          this.converterId = converterId;
58      }
59  
60      public Class getForClass()
61      {
62          return forClass;
63      }
64  
65      public void setForClass(Class forClass)
66      {
67          this.forClass = forClass;
68      }
69  
70      public Type getType()
71      {
72          return type;
73      }
74  
75      public void setType(Type type)
76      {
77          this.type = type;
78      }
79  
80      @Override
81      public int hashCode()
82      {
83          int hash = 7;
84          hash = 53 * hash + Objects.hashCode(this.type);
85          hash = 53 * hash + Objects.hashCode(this.forClass);
86          hash = 53 * hash + Objects.hashCode(this.converterId);
87          return hash;
88      }
89  
90      @Override
91      public boolean equals(Object obj)
92      {
93          if (obj == null)
94          {
95              return false;
96          }
97          if (getClass() != obj.getClass())
98          {
99              return false;
100         }
101         final FacesConverterInfo other = (FacesConverterInfo) obj;
102         if (!Objects.equals(this.type, other.type))
103         {
104             return false;
105         }
106         if (!Objects.equals(this.forClass, other.forClass))
107         {
108             return false;
109         }
110         if (!Objects.equals(this.converterId, other.converterId))
111         {
112             return false;
113         }
114         return true;
115     }
116 
117 
118 }