/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. */
  5. package org.diffkit.common.kvc.tst;
  6. import java.util.LinkedHashSet;
  7. import java.util.Set;
  8. import org.apache.commons.lang.builder.ReflectionToStringBuilder;
  9. import org.slf4j.Logger;
  10. import org.slf4j.LoggerFactory;
  11. /**
  12. * @author jpanico
  13. *
  14. */
  15. public class Person {
  16. public enum Gender {
  17. MALE, FEMALE;
  18. }
  19. private String _name;
  20. private Gender _gender;
  21. private Boolean _isDead;
  22. private Person _mother;
  23. private Person _father;
  24. private LinkedHashSet<Person> _children;
  25. private String _state;
  26. private final Logger _log = LoggerFactory.getLogger(this.getClass());
  27. public Person() {
  28. }
  29. public Person(String name_, Boolean isDead_, Person mother_, Person father_,
  30. Set<Person> children_) {
  31. _name = name_;
  32. _isDead = isDead_;
  33. _mother = mother_;
  34. _father = father_;
  35. _children = (children_ != null ? new LinkedHashSet<Person>(children_)
  36. : new LinkedHashSet<Person>());
  37. }
  38. public Object getId() {
  39. return _name;
  40. }
  41. public String getName() {
  42. return _name;
  43. }
  44. public Gender getGender() {
  45. return _gender;
  46. }
  47. public Person getMother() {
  48. return _mother;
  49. }
  50. public void setMother(Person mother_) {
  51. _mother = mother_;
  52. }
  53. public Person getFather() {
  54. return _father;
  55. }
  56. public String getState() {
  57. return _state;
  58. }
  59. public void setState(String state_) {
  60. _state = state_;
  61. }
  62. public Boolean getIsDead() {
  63. return _isDead;
  64. }
  65. public void logTest() {
  66. _log.info("test");
  67. }
  68. public String toString() {
  69. return ReflectionToStringBuilder.toString(this);
  70. }
  71. }