View Javadoc

1   /*
2    * Copyright (c) 2010 Commsen International. All rights reserved.
3    * 
4    * This file is part of JWebThumb library.
5    *	
6    * JWebThumb library is free software: you can redistribute it and/or modify 
7    * it under the terms of the GNU Lesser General Public License as published by
8    * the Free Software Foundation, either version 2 of the License, or
9    * (at your option) any later version.
10   * 
11   * JWebThumb library is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   * GNU Lesser General Public License for more details.
15   * 
16   * You should have received a copy of the GNU Lesser General Public License
17   * along with JWebThumb library.  If not, see <http://www.gnu.org/licenses/lgpl.html>.
18   */
19  package com.commsen.jwebthumb;
20  
21  import org.apache.commons.lang.builder.ReflectionToStringBuilder;
22  import org.simpleframework.xml.Attribute;
23  import org.simpleframework.xml.Text;
24  
25  /***
26   * This class represents 'error' part of webthumb's response. See <a
27   * href="http://webthumb.bluga.net/apidoc#errorhandling"
28   * >http://webthumb.bluga.net/apidoc#errorhandling</a> for details
29   * 
30   * @author <a href="mailto:MilenDyankov@gmail.com">Milen Dyankov</a>
31   * @see http://webthumb.bluga.net/apidoc#errorhandling
32   * @since 0.3
33   */
34  public class WebThumbError {
35  
36  	@Text(required = false)
37  	private String value;
38  
39  	@Attribute(required = false)
40  	private String type;
41  
42  	@Attribute(required = false)
43  	private String code;
44  
45  	@Attribute(required = false)
46  	private String url;
47  
48  
49  	/***
50  	 * @return the value
51  	 */
52  	public String getValue() {
53  		return this.value;
54  	}
55  
56  
57  	/***
58  	 * @return the type
59  	 */
60  	public String getType() {
61  		return this.type;
62  	}
63  
64  
65  	/***
66  	 * @return the code
67  	 */
68  	public String getCode() {
69  		return this.code;
70  	}
71  
72  
73  	/***
74  	 * @return the url
75  	 */
76  	public String getUrl() {
77  		return this.url;
78  	}
79  
80  
81  	@Override
82  	public String toString() {
83  		return new ReflectionToStringBuilder(this).toString();
84  	}
85  
86  }