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.view;
20  
21  import java.io.Serializable;
22  
23  /**
24   *
25   * @author Leonardo Uribe
26   */
27  class ViewScopeContextualKey implements Serializable
28  {
29      private String name;
30  
31      public ViewScopeContextualKey(String name)
32      {
33          this.name = name;
34      }
35      
36      public ViewScopeContextualKey()
37      {
38      }
39      /**
40       * @return the name
41       */
42      public String getName()
43      {
44          return name;
45      }
46  
47      @Override
48      public int hashCode()
49      {
50          int hash = 7;
51          hash = 83 * hash + (this.name != null ? this.name.hashCode() : 0);
52          return hash;
53      }
54  
55      @Override
56      public boolean equals(Object obj)
57      {
58          if (obj == null)
59          {
60              return false;
61          }
62          if (getClass() != obj.getClass())
63          {
64              return false;
65          }
66          final ViewScopeContextualKey other = (ViewScopeContextualKey) obj;
67          if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name))
68          {
69              return false;
70          }
71          return true;
72      }
73  }