2015-07-08 15:24:32 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
package org.gcube.accounting.analytics;
|
|
|
|
|
2015-07-14 18:45:48 +02:00
|
|
|
import java.text.SimpleDateFormat;
|
2015-09-08 11:49:47 +02:00
|
|
|
import java.util.Calendar;
|
2015-07-14 18:45:48 +02:00
|
|
|
|
|
|
|
import org.json.JSONObject;
|
|
|
|
|
2015-07-09 16:39:25 +02:00
|
|
|
|
2015-07-08 15:24:32 +02:00
|
|
|
/**
|
2016-10-12 14:09:44 +02:00
|
|
|
* @author Luca Frosini (ISTI - CNR)
|
2015-07-08 15:24:32 +02:00
|
|
|
*
|
|
|
|
*/
|
2015-07-14 18:45:48 +02:00
|
|
|
public class Info {
|
2015-07-08 15:24:32 +02:00
|
|
|
|
2015-09-08 11:49:47 +02:00
|
|
|
protected Calendar calendar;
|
2015-07-14 18:45:48 +02:00
|
|
|
protected JSONObject value;
|
2015-07-08 15:24:32 +02:00
|
|
|
|
2015-07-14 18:45:48 +02:00
|
|
|
/**
|
2015-09-29 16:25:58 +02:00
|
|
|
* @param calendar the date
|
2015-09-07 16:36:08 +02:00
|
|
|
* @param value the JSON value
|
2015-07-14 18:45:48 +02:00
|
|
|
*/
|
2015-09-08 11:49:47 +02:00
|
|
|
public Info(Calendar calendar, JSONObject value) {
|
2015-07-14 18:45:48 +02:00
|
|
|
super();
|
2015-09-08 11:49:47 +02:00
|
|
|
this.calendar = calendar;
|
2015-07-14 18:45:48 +02:00
|
|
|
this.value = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-07-15 11:13:39 +02:00
|
|
|
* @return the date
|
2015-07-14 18:45:48 +02:00
|
|
|
*/
|
2015-09-08 11:49:47 +02:00
|
|
|
public Calendar getCalendar() {
|
|
|
|
return calendar;
|
2015-07-14 18:45:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-09-29 16:25:58 +02:00
|
|
|
* @param calendar the date to set
|
2015-07-14 18:45:48 +02:00
|
|
|
*/
|
2015-09-08 11:49:47 +02:00
|
|
|
public void setCalendar(Calendar calendar) {
|
|
|
|
this.calendar = calendar;
|
2015-07-14 18:45:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return the value
|
|
|
|
*/
|
|
|
|
public JSONObject getValue() {
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param value the value to set
|
|
|
|
*/
|
|
|
|
public void setValue(JSONObject value) {
|
|
|
|
this.value = value;
|
|
|
|
}
|
2015-07-08 15:24:32 +02:00
|
|
|
|
2015-07-14 18:45:48 +02:00
|
|
|
@Override
|
|
|
|
public String toString(){
|
2015-07-15 10:32:27 +02:00
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SS z");
|
2015-07-21 16:33:36 +02:00
|
|
|
simpleDateFormat.setTimeZone(TemporalConstraint.DEFAULT_TIME_ZONE);
|
2015-09-08 11:49:47 +02:00
|
|
|
return String.format("Date : %s, Value : %s", simpleDateFormat.format(calendar.getTime()), value.toString());
|
2015-07-14 18:45:48 +02:00
|
|
|
}
|
2015-07-08 15:24:32 +02:00
|
|
|
}
|