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.myfaces.cdi.managedproperty;
20  
21  import java.io.Serializable;
22  import java.lang.reflect.Type;
23  import java.util.Objects;
24  
25  /**
26   *
27   */
28  public class ManagedPropertyInfo implements Serializable
29  {
30  
31      private Type type;
32  
33      private String expression;
34  
35      public ManagedPropertyInfo(Type type, String expression)
36      {
37          this.type = type;
38          this.expression = expression;
39      }
40  
41      /**
42       * @return the type
43       */
44      public Type getType()
45      {
46          return type;
47      }
48  
49      /**
50       * @return the expression
51       */
52      public String getExpression()
53      {
54          return expression;
55      }
56  
57      @Override
58      public int hashCode()
59      {
60          int hash = 3;
61          hash = 79 * hash + Objects.hashCode(this.type);
62          hash = 79 * hash + Objects.hashCode(this.expression);
63          return hash;
64      }
65  
66      @Override
67      public boolean equals(Object obj)
68      {
69          if (obj == null)
70          {
71              return false;
72          }
73          if (getClass() != obj.getClass())
74          {
75              return false;
76          }
77          final ManagedPropertyInfo other = (ManagedPropertyInfo) obj;
78          if (!Objects.equals(this.type, other.type))
79          {
80              return false;
81          }
82          if (!Objects.equals(this.expression, other.expression))
83          {
84              return false;
85          }
86          return true;
87      }
88  
89  }