• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 Wrapper {
17 
18   private String name;
19   private int age;
20   private String color;
21   private String type;
22 
createBean()23   public JavaBeanWithStaticState createBean() {
24     JavaBeanWithStaticState bean = new JavaBeanWithStaticState();
25     bean.setAge(age);
26     bean.setName(name);
27     JavaBeanWithStaticState.color = color;
28     JavaBeanWithStaticState.setType(type);
29     return bean;
30   }
31 
Wrapper()32   public Wrapper() {
33     color = JavaBeanWithStaticState.color;
34     type = JavaBeanWithStaticState.getType();
35   }
36 
Wrapper(JavaBeanWithStaticState bean)37   public Wrapper(JavaBeanWithStaticState bean) {
38     this();
39     name = bean.getName();
40     age = bean.getAge();
41   }
42 
getName()43   public String getName() {
44     return name;
45   }
46 
setName(String name)47   public void setName(String name) {
48     this.name = name;
49   }
50 
getAge()51   public int getAge() {
52     return age;
53   }
54 
setAge(int age)55   public void setAge(int age) {
56     this.age = age;
57   }
58 
getColor()59   public String getColor() {
60     return color;
61   }
62 
setColor(String color)63   public void setColor(String color) {
64     this.color = color;
65   }
66 
getType()67   public String getType() {
68     return type;
69   }
70 
setType(String type)71   public void setType(String type) {
72     this.type = type;
73   }
74 }
75