View Javadoc

1   /*
2    * $Id: Bean2.java 1188791 2011-10-25 17:03:22Z mcucchiara $
3    * Licensed to the Apache Software Foundation (ASF) under one
4    * or more contributor license agreements.  See the NOTICE file
5    * distributed with this work for additional information
6    * regarding copyright ownership.  The ASF licenses this file
7    * to you under the Apache License, Version 2.0 (the
8    * "License"); you may not use this file except in compliance
9    * with the License.  You may obtain a copy of the License at
10   *
11   * http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing,
14   * software distributed under the License is distributed on an
15   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16   * KIND, either express or implied.  See the License for the
17   * specific language governing permissions and limitations
18   * under the License.
19   */
20  package org.apache.commons.ognl.test.objects;
21  
22  public class Bean2
23  {
24      private Bean3 bean3 = new Bean3();
25  
26      private boolean _pageBreakAfter = false;
27  
28      public Long getId()
29      {
30          return 1l;
31      }
32  
33      public Bean3 getBean3()
34      {
35          return bean3;
36      }
37  
38      public long getMillis()
39      {
40          return 1000 * 60 * 2;
41      }
42  
43      public boolean isCarrier()
44      {
45          return false;
46      }
47  
48      public boolean isPageBreakAfter()
49      {
50          return _pageBreakAfter;
51      }
52  
53      public void setPageBreakAfter( boolean value )
54      {
55          _pageBreakAfter = value;
56      }
57  
58      public void togglePageBreakAfter()
59      {
60          _pageBreakAfter ^= true;
61      }
62  
63      public boolean equals( Object o )
64      {
65          if ( this == o )
66              return true;
67          if ( o == null || getClass() != o.getClass() )
68              return false;
69  
70          Bean2 bean2 = (Bean2) o;
71  
72          return _pageBreakAfter == bean2._pageBreakAfter;
73  
74      }
75  
76      public int hashCode()
77      {
78          return ( _pageBreakAfter ? 1 : 0 );
79      }
80  }