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 java.util.Date;
22  
23  import org.apache.commons.lang.builder.ReflectionToStringBuilder;
24  import org.simpleframework.xml.Attribute;
25  import org.simpleframework.xml.Text;
26  
27  /***
28   * This class represents 'jobs' part of webthumb's response to "request" API call. See <a
29   * href="http://webthumb.bluga.net/apidoc#request">http://webthumb.bluga.net/apidoc#request</a> for
30   * details
31   * 
32   * @author <a href="mailto:MilenDyankov@gmail.com">Milen Dyankov</a>
33   * @see http://webthumb.bluga.net/apidoc#request
34   * 
35   */
36  public class WebThumbJob {
37  
38  	@Attribute
39  	private int estimate;
40  
41  	@Attribute(name = "time")
42  	private Date time;
43  
44  	@Attribute
45  	private String url;
46  
47  	@Attribute
48  	private int cost;
49  
50  	@Text
51  	private String id;
52  
53  
54  	/***
55  	 * @return the estimate
56  	 */
57  	public int getEstimate() {
58  		return this.estimate;
59  	}
60  
61  
62  	/***
63  	 * @return the time
64  	 */
65  	public Date getTime() {
66  		return this.time == null ? null : (Date) this.time.clone();
67  	}
68  
69  
70  	/***
71  	 * @return the url
72  	 */
73  	public String getUrl() {
74  		return this.url;
75  	}
76  
77  
78  	/***
79  	 * @return the cost
80  	 */
81  	public int getCost() {
82  		return this.cost;
83  	}
84  
85  
86  	/***
87  	 * @return the id
88  	 */
89  	public String getId() {
90  		return this.id;
91  	}
92  
93  
94  	@Override
95  	public String toString() {
96  		return new ReflectionToStringBuilder(this).toString();
97  	}
98  }