refs #166: Create accouting-analytics library

https://support.d4science.org/issues/166

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-analytics@117246 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2015-07-15 09:13:39 +00:00
parent e9993a2300
commit d07f041563
1 changed files with 12 additions and 12 deletions

View File

@ -4,7 +4,7 @@
package org.gcube.accounting.analytics; package org.gcube.accounting.analytics;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Calendar; import java.util.Date;
import java.util.TimeZone; import java.util.TimeZone;
import org.json.JSONObject; import org.json.JSONObject;
@ -16,31 +16,31 @@ import org.json.JSONObject;
*/ */
public class Info { public class Info {
protected Calendar calendar; protected Date date;
protected JSONObject value; protected JSONObject value;
/** /**
* @param calendar * @param calendar
* @param value * @param value
*/ */
public Info(Calendar calendar, JSONObject value) { public Info(Date date, JSONObject value) {
super(); super();
this.calendar = calendar; this.date = date;
this.value = value; this.value = value;
} }
/** /**
* @return the calendar * @return the date
*/ */
public Calendar getCalendar() { public Date getDate() {
return calendar; return date;
} }
/** /**
* @param calendar the calendar to set * @param date the date to set
*/ */
public void setCalendar(Calendar calendar) { public void setDate(Date date) {
this.calendar = calendar; this.date = date;
} }
/** /**
@ -60,7 +60,7 @@ public class Info {
@Override @Override
public String toString(){ public String toString(){
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SS z"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SS z");
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
return String.format("Date : %s, Value : %s", simpleDateFormat.format(calendar.getTime()), value.toString()); return String.format("Date : %s, Value : %s", simpleDateFormat.format(date), value.toString());
} }
} }