some basic stuff
[fac.git] / src / net / pterodactylus / fac / core / Insert.java
1 /*
2  * fac - Insert.java -
3  * Copyright © 2008 David Roden
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  */
19
20 package net.pterodactylus.fac.core;
21
22 /**
23  * Data container that keeps statistics of an insert.
24  * 
25  * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
26  */
27 public class Insert {
28
29         /** The time the data was inserted. */
30         private long insertTime;
31
32         /** The URI the data generated. */
33         private String uri;
34
35         /** The time the data should be retrieved. */
36         private long checkTime;
37
38         /** Whether the data was already checked. */
39         private boolean checked;
40
41         /** Whether the data was successfully downloaded. */
42         private boolean successful;
43
44         /**
45          * Returns the time the data was inserted.
46          * 
47          * @return The time the data was inserted
48          */
49         public long getInsertTime() {
50                 return insertTime;
51         }
52
53         /**
54          * Sets the time the data was inserted.
55          * 
56          * @param insertTime
57          *            The time the data was inserted
58          */
59         public void setInsertTime(long insertTime) {
60                 this.insertTime = insertTime;
61         }
62
63         /**
64          * Returns the URI generated by the data.
65          * 
66          * @return The URI of the data
67          */
68         public String getURI() {
69                 return uri;
70         }
71
72         /**
73          * Sets the URI generated by the data
74          * 
75          * @param uri
76          *            The URI of the data
77          */
78         public void setURI(String uri) {
79                 this.uri = uri;
80         }
81
82         /**
83          * Returns the time the data should be checked.
84          * 
85          * @return The time the data should be checked
86          */
87         public long getCheckTime() {
88                 return checkTime;
89         }
90
91         /**
92          * Sets the time the data should be checked.
93          * 
94          * @param checkTime
95          *            The time the data should be checked
96          */
97         public void setCheckTime(long checkTime) {
98                 this.checkTime = checkTime;
99         }
100
101         /**
102          * Returns whether the data has already been checked, i.e. a check already
103          * returned a result.
104          * 
105          * @return <code>true</code> if the data was already checked,
106          *         <code>false</code> otherwise
107          */
108         public boolean isChecked() {
109                 return checked;
110         }
111
112         /**
113          * Sets whether the data has already been checked, i.e. a check already
114          * returned a result.
115          * 
116          * @param checked
117          *            <code>true</code> if the data was already checked,
118          *            <code>false</code> otherwise
119          */
120         public void setChecked(boolean checked) {
121                 this.checked = checked;
122         }
123
124         /**
125          * Returns whether the data was checked successfully.
126          * 
127          * @return <code>true</code> if the data was checked successfully,
128          *         <code>false</code> otherwise
129          */
130         public boolean isSuccessful() {
131                 return successful;
132         }
133
134         /**
135          * Sets whether the data was checked successfully.
136          * 
137          * @param successful
138          *            <code>true</code> if the data was checked successfully,
139          *            <code>false</code> otherwise
140          */
141         public void setSuccessful(boolean successful) {
142                 this.successful = successful;
143         }
144
145 }