1 /***
2 * Copyright 2003-2010 Terracotta, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * 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 net.sf.ehcache.search;
18
19 import java.io.Serializable;
20
21 /***
22 * A domain object used for testing
23 *
24 * @author Greg Luck
25 */
26 public class Person implements Serializable {
27
28 private final String name;
29 private final int age;
30 private final Gender gender;
31
32 public Person(String name, int age, Gender gender) {
33 this.name = name;
34 this.age = age;
35 this.gender = gender;
36 }
37
38 public String getName() {
39 return name;
40 }
41
42 public int getAge() {
43 return age;
44 }
45
46 public Gender getGender() {
47 return gender;
48 }
49
50 @Override
51 public String toString() {
52 return getClass().getSimpleName() + "(name:" + name + ", age:" + age + ", sex:" + gender.name().toLowerCase() + ")";
53 }
54
55 enum Gender {
56 MALE, FEMALE;
57 }
58
59 }