PageRenderTime 19ms CodeModel.GetById 2ms app.highlight 13ms RepoModel.GetById 1ms app.codeStats 0ms

/tst/org/diffkit/common/kvc/tst/Person.java

http://diffkit.googlecode.com/
Java | 89 lines | 63 code | 18 blank | 8 comment | 1 complexity | 7ef44d8384b2186296dfda67b95b13c3 MD5 | raw file
 1/**
 2 * Copyright Š 2010, Joseph Panico
 3 *	All rights reserved.
 4 */
 5package org.diffkit.common.kvc.tst;
 6
 7import java.util.LinkedHashSet;
 8import java.util.Set;
 9
10import org.apache.commons.lang.builder.ReflectionToStringBuilder;
11import org.slf4j.Logger;
12import org.slf4j.LoggerFactory;
13
14/**
15 * @author jpanico
16 * 
17 */
18public class Person {
19
20   public enum Gender {
21      MALE, FEMALE;
22   }
23
24   private String _name;
25   private Gender _gender;
26   private Boolean _isDead;
27   private Person _mother;
28   private Person _father;
29   private LinkedHashSet<Person> _children;
30   private String _state;
31   private final Logger _log = LoggerFactory.getLogger(this.getClass());
32
33   public Person() {
34   }
35
36   public Person(String name_, Boolean isDead_, Person mother_, Person father_,
37                 Set<Person> children_) {
38      _name = name_;
39      _isDead = isDead_;
40      _mother = mother_;
41      _father = father_;
42      _children = (children_ != null ? new LinkedHashSet<Person>(children_)
43         : new LinkedHashSet<Person>());
44   }
45
46   public Object getId() {
47      return _name;
48   }
49
50   public String getName() {
51      return _name;
52   }
53
54   public Gender getGender() {
55      return _gender;
56   }
57
58   public Person getMother() {
59      return _mother;
60   }
61
62   public void setMother(Person mother_) {
63      _mother = mother_;
64   }
65
66   public Person getFather() {
67      return _father;
68   }
69
70   public String getState() {
71      return _state;
72   }
73
74   public void setState(String state_) {
75      _state = state_;
76   }
77
78   public Boolean getIsDead() {
79      return _isDead;
80   }
81
82   public void logTest() {
83      _log.info("test");
84   }
85
86   public String toString() {
87      return ReflectionToStringBuilder.toString(this);
88   }
89}