1 /** 2 * Copyright (c) 2008, SnakeYAML 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 * in compliance with the 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 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 * or implied. See the License for the specific language governing permissions and limitations under 12 * the License. 13 */ 14 package examples.staticstate; 15 16 public class JavaBeanWithStaticState { 17 18 private String name; 19 private int age; 20 public static String color;// public field 21 private static String type;// private field with a getter 22 getName()23 public String getName() { 24 return name; 25 } 26 setName(String name)27 public void setName(String name) { 28 this.name = name; 29 } 30 getAge()31 public int getAge() { 32 return age; 33 } 34 setAge(int age)35 public void setAge(int age) { 36 this.age = age; 37 } 38 getType()39 public static String getType() { 40 return type; 41 } 42 setType(String type)43 public static void setType(String type) { 44 JavaBeanWithStaticState.type = type; 45 } 46 } 47