1 /* Licensed to the Apache Software Foundation (ASF) under one or more 2 * contributor license agreements. See the NOTICE file distributed with 3 * this work for additional information regarding copyright ownership. 4 * The ASF licenses this file to You under the Apache License, Version 2.0 5 * (the "License"); you may not use this file except in compliance with 6 * the License. You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package org.apache.harmony.luni.tests.java.lang; 18 19 import java.io.Serializable; 20 21 class MockEnum implements Serializable { 22 private static final long serialVersionUID = -1678507713086705252L; 23 24 enum Sample { 25 LARRY, MOE, CURLY 26 } 27 28 enum Sample2 { 29 RED, BLUE, YELLO 30 } 31 32 String str; 33 34 int i; 35 36 Sample2 samEnum; 37 38 Sample larry = Sample.LARRY; 39 40 MockEnum() { 41 str = "test"; 42 i = 99; 43 samEnum = Sample2.BLUE; 44 } 45 46 public boolean equals(Object arg0) { 47 if (!(arg0 instanceof MockEnum)) { 48 return false; 49 } 50 MockEnum test = (MockEnum) arg0; 51 if (str.equals(test.str) && i == test.i && samEnum == test.samEnum) { 52 return true; 53 } 54 return false; 55 } 56 57 } 58