001 /* 002 * $Id: Bean2.java 1188791 2011-10-25 17:03:22Z mcucchiara $ 003 * Licensed to the Apache Software Foundation (ASF) under one 004 * or more contributor license agreements. See the NOTICE file 005 * distributed with this work for additional information 006 * regarding copyright ownership. The ASF licenses this file 007 * to you under the Apache License, Version 2.0 (the 008 * "License"); you may not use this file except in compliance 009 * with the License. You may obtain a copy of the License at 010 * 011 * http://www.apache.org/licenses/LICENSE-2.0 012 * 013 * Unless required by applicable law or agreed to in writing, 014 * software distributed under the License is distributed on an 015 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 016 * KIND, either express or implied. See the License for the 017 * specific language governing permissions and limitations 018 * under the License. 019 */ 020 package org.apache.commons.ognl.test.objects; 021 022 public class Bean2 023 { 024 private Bean3 bean3 = new Bean3(); 025 026 private boolean _pageBreakAfter = false; 027 028 public Long getId() 029 { 030 return 1l; 031 } 032 033 public Bean3 getBean3() 034 { 035 return bean3; 036 } 037 038 public long getMillis() 039 { 040 return 1000 * 60 * 2; 041 } 042 043 public boolean isCarrier() 044 { 045 return false; 046 } 047 048 public boolean isPageBreakAfter() 049 { 050 return _pageBreakAfter; 051 } 052 053 public void setPageBreakAfter( boolean value ) 054 { 055 _pageBreakAfter = value; 056 } 057 058 public void togglePageBreakAfter() 059 { 060 _pageBreakAfter ^= true; 061 } 062 063 public boolean equals( Object o ) 064 { 065 if ( this == o ) 066 return true; 067 if ( o == null || getClass() != o.getClass() ) 068 return false; 069 070 Bean2 bean2 = (Bean2) o; 071 072 return _pageBreakAfter == bean2._pageBreakAfter; 073 074 } 075 076 public int hashCode() 077 { 078 return ( _pageBreakAfter ? 1 : 0 ); 079 } 080 }