1   /*
2    * Copyright 2002-2009 the original author or authors.
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  
17  package net.sf.json.sample;
18  
19  import java.util.List;
20  import java.util.Map;
21  
22  import net.sf.json.JSONFunction;
23  
24  import org.apache.commons.lang.builder.ToStringBuilder;
25  import org.apache.commons.lang.builder.ToStringStyle;
26  
27  /**
28   * @author Andres Almiray <aalmiray@users.sourceforge.net>
29   */
30  public class PrimitiveBean {
31     private Object[] oarray;
32     private int[] parray;
33     private ObjectBean pbean;
34     private boolean pboolean;
35     private byte pbyte;
36     private char pchar;
37     private Class pclass;
38     private double pdouble;
39     private String pexcluded;
40     private float pfloat;
41     private JSONFunction pfunction;
42     private int pint;
43     private List plist;
44     private long plong;
45     private Map pmap;
46     private short pshort;
47     private String pstring;
48  
49     public Object[] getOarray() {
50        return oarray;
51     }
52  
53     public int[] getParray() {
54        return parray;
55     }
56  
57     public ObjectBean getPbean() {
58        return pbean;
59     }
60  
61     public byte getPbyte() {
62        return pbyte;
63     }
64  
65     public char getPchar() {
66        return pchar;
67     }
68  
69     public Class getPclass() {
70        return pclass;
71     }
72  
73     public double getPdouble() {
74        return pdouble;
75     }
76  
77     public String getPexcluded() {
78        return pexcluded;
79     }
80  
81     public float getPfloat() {
82        return pfloat;
83     }
84  
85     public JSONFunction getPfunction() {
86        return pfunction;
87     }
88  
89     public int getPint() {
90        return pint;
91     }
92  
93     public List getPlist() {
94        return plist;
95     }
96  
97     public long getPlong() {
98        return plong;
99     }
100 
101    public Map getPmap() {
102       return pmap;
103    }
104 
105    public short getPshort() {
106       return pshort;
107    }
108 
109    public String getPstring() {
110       return pstring;
111    }
112 
113    public boolean isPboolean() {
114       return pboolean;
115    }
116 
117    public void setOarray( Object[] oarray ) {
118       this.oarray = oarray;
119    }
120 
121    public void setParray( int[] parray ) {
122       this.parray = parray;
123    }
124 
125    public void setPbean( ObjectBean pbean ) {
126       this.pbean = pbean;
127    }
128 
129    public void setPboolean( boolean pboolean ) {
130       this.pboolean = pboolean;
131    }
132 
133    public void setPbyte( byte pbyte ) {
134       this.pbyte = pbyte;
135    }
136 
137    public void setPchar( char pchar ) {
138       this.pchar = pchar;
139    }
140 
141    public void setPclass( Class pclass ) {
142       this.pclass = pclass;
143    }
144 
145    public void setPdouble( double pdouble ) {
146       this.pdouble = pdouble;
147    }
148 
149    public void setPexcluded( String pexcluded ) {
150       this.pexcluded = pexcluded;
151    }
152 
153    public void setPfloat( float pfloat ) {
154       this.pfloat = pfloat;
155    }
156 
157    public void setPfunction( JSONFunction pfunction ) {
158       this.pfunction = pfunction;
159    }
160 
161    public void setPint( int pint ) {
162       this.pint = pint;
163    }
164 
165    public void setPlist( List plist ) {
166       this.plist = plist;
167    }
168 
169    public void setPlong( long plong ) {
170       this.plong = plong;
171    }
172 
173    public void setPmap( Map pmap ) {
174       this.pmap = pmap;
175    }
176 
177    public void setPshort( short pshort ) {
178       this.pshort = pshort;
179    }
180 
181    public void setPstring( String pstring ) {
182       this.pstring = pstring;
183    }
184 
185    public String toString() {
186       return ToStringBuilder.reflectionToString( this, ToStringStyle.MULTI_LINE_STYLE );
187    }
188 }