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-07-15 11:13:39 +02:00
|
|
|
import java.util.Date;
|
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
|
|
|
/**
|
|
|
|
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
|
|
|
*
|
|
|
|
*/
|
2015-07-14 18:45:48 +02:00
|
|
|
public class Info {
|
2015-07-08 15:24:32 +02:00
|
|
|
|
2015-07-15 11:13:39 +02:00
|
|
|
protected Date date;
|
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
|
|
|
/**
|
|
|
|
* @param calendar
|
|
|
|
* @param value
|
|
|
|
*/
|
2015-07-15 11:13:39 +02:00
|
|
|
public Info(Date date, JSONObject value) {
|
2015-07-14 18:45:48 +02:00
|
|
|
super();
|
2015-07-15 11:13:39 +02:00
|
|
|
this.date = date;
|
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-07-15 11:13:39 +02:00
|
|
|
public Date getDate() {
|
|
|
|
return date;
|
2015-07-14 18:45:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-07-15 11:13:39 +02:00
|
|
|
* @param date the date to set
|
2015-07-14 18:45:48 +02:00
|
|
|
*/
|
2015-07-15 11:13:39 +02:00
|
|
|
public void setDate(Date date) {
|
|
|
|
this.date = date;
|
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-07-15 11:13:39 +02:00
|
|
|
return String.format("Date : %s, Value : %s", simpleDateFormat.format(date), value.toString());
|
2015-07-14 18:45:48 +02:00
|
|
|
}
|
2015-07-08 15:24:32 +02:00
|
|
|
}
|