1 /** 2 * Copyright (c) 2008, http://www.snakeyaml.org 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 package examples.staticstate; 17 18 public class Wrapper { 19 private String name; 20 private int age; 21 private String color; 22 private String type; 23 createBean()24 public JavaBeanWithStaticState createBean() { 25 JavaBeanWithStaticState bean = new JavaBeanWithStaticState(); 26 bean.setAge(age); 27 bean.setName(name); 28 JavaBeanWithStaticState.color = color; 29 JavaBeanWithStaticState.setType(type); 30 return bean; 31 } 32 Wrapper()33 public Wrapper() { 34 color = JavaBeanWithStaticState.color; 35 type = JavaBeanWithStaticState.getType(); 36 } 37 Wrapper(JavaBeanWithStaticState bean)38 public Wrapper(JavaBeanWithStaticState bean) { 39 this(); 40 name = bean.getName(); 41 age = bean.getAge(); 42 } 43 getName()44 public String getName() { 45 return name; 46 } 47 setName(String name)48 public void setName(String name) { 49 this.name = name; 50 } 51 getAge()52 public int getAge() { 53 return age; 54 } 55 setAge(int age)56 public void setAge(int age) { 57 this.age = age; 58 } 59 getColor()60 public String getColor() { 61 return color; 62 } 63 setColor(String color)64 public void setColor(String color) { 65 this.color = color; 66 } 67 getType()68 public String getType() { 69 return type; 70 } 71 setType(String type)72 public void setType(String type) { 73 this.type = type; 74 } 75 }