Debian Codegraph @

src/test/java/org/fest/reflect/Person.java

raw
1 /*
2 * Created on May 17, 2007
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
5 * License. You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS"
10 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language
11 * governing permissions and limitations under the License.
12 *
13 * Copyright @2007-2009 the original author or authors.
14 */
15 package org.fest.reflect;
16
17 /**
18 * Understands a person.
19 *
20 * @author Yvonne Wang
21 */
22 public class Person {
23
24 private static int count;
25
26 private String name;
27
28 public Person() {}
29
30 public Person(String name) {
31 setName(name);
32 }
33
34 public Person(int name) {
35 throw new IllegalArgumentException("The name of a person cannot be a number");
36 }
37
38 public Person(Person person) throws Exception {
39 throw new Exception("A person cannot be created from another person");
40 }
41
42 public String getName() {
43 return name;
44 }
45
46 public void setName(String name) {
47 this.name = name;
48 }
49
50 public static int getCount() {
51 return count;
52 }
53
54 public static void setCount(int count) {
55 Person.count = count;
56 }
57 }