180 lines
3.4 KiB
Java
180 lines
3.4 KiB
Java
/*
|
|
*
|
|
*/
|
|
package org.gcube.dataharvest.datamodel;
|
|
|
|
import java.io.Serializable;
|
|
import java.util.Date;
|
|
|
|
/**
|
|
* The Class HarvestedData.
|
|
*
|
|
* @author Eric Perrone (ISTI - CNR)
|
|
* @author Luca Frosini
|
|
* @author Francesco Mangiacrapa (ISTI - CNR)
|
|
*/
|
|
public class HarvestedData implements Serializable {
|
|
|
|
/**
|
|
* Generated Serial Version UID
|
|
*/
|
|
private static final long serialVersionUID = 3699669951917080213L;
|
|
|
|
// public static int ACCESSESS = 1;
|
|
// public static int USERS = 2;
|
|
// public static int DATA_METHOD_DOWNLOAD = 3;
|
|
// public static int NEW_CATALOGUE_METHODS = 4;
|
|
// public static int NEW_CATALOGUE_DATASETS = 5;
|
|
// public static int NEW_CATALOGUE_DELIVERABLES = 6;
|
|
// public static int NEW_CATALOGUE_APPLICATIONS = 7;
|
|
// public static int SOCIAL_POSTS = 8;
|
|
// public static int SOCIAL_REPLIES = 9;
|
|
// public static int SOCIAL_LIKES = 10;
|
|
// public static int METHOD_INVOCATIONS = 11;
|
|
// public static int VISUAL_TOOLS = 12;
|
|
|
|
private int dataType;
|
|
private String context;
|
|
private long measure;
|
|
private Date day;
|
|
private HarvestedDataKey harvestedDataKey;
|
|
|
|
/**
|
|
* Instantiates a new harvested data.
|
|
*/
|
|
public HarvestedData() {
|
|
|
|
}
|
|
|
|
/**
|
|
* Instantiates a new harvested data.
|
|
*
|
|
* @param key the key
|
|
*/
|
|
private HarvestedData(HarvestedDataKey key){
|
|
this.harvestedDataKey = key;
|
|
setDataType(harvestedDataKey.getValue());
|
|
}
|
|
|
|
/**
|
|
* Instantiates a new harvested data.
|
|
*
|
|
* @param key the key
|
|
* @param context the context
|
|
* @param measure the measure
|
|
* @param day the day
|
|
*/
|
|
public HarvestedData(HarvestedDataKey key, String context, long measure, Date day) {
|
|
this(key);
|
|
this.context = context;
|
|
this.measure = measure;
|
|
this.day = day;
|
|
}
|
|
|
|
/**
|
|
* Instantiates a new harvested data.
|
|
*
|
|
* @param key the key
|
|
* @param context the context
|
|
* @param measure the measure
|
|
*/
|
|
public HarvestedData(HarvestedDataKey key, String context, long measure) {
|
|
this(key);
|
|
this.context = context;
|
|
this.measure = measure;
|
|
}
|
|
|
|
/**
|
|
* Sets the data type.
|
|
*
|
|
* @param dataType the new data type
|
|
*/
|
|
private void setDataType(int dataType) {
|
|
this.dataType = dataType;
|
|
}
|
|
|
|
/**
|
|
* Sets the context.
|
|
*
|
|
* @param context the new context
|
|
*/
|
|
public void setContext(String context) {
|
|
this.context = context;
|
|
}
|
|
|
|
/**
|
|
* Sets the measure.
|
|
*
|
|
* @param measure the new measure
|
|
*/
|
|
public void setMeasure(long measure) {
|
|
this.measure = measure;
|
|
}
|
|
|
|
/**
|
|
* Sets the day.
|
|
*
|
|
* @param day the new day
|
|
*/
|
|
public void setDay(Date day) {
|
|
this.day = day;
|
|
}
|
|
|
|
/**
|
|
* Gets the data type.
|
|
*
|
|
* @return the data type
|
|
*/
|
|
public int getDataType() {
|
|
return dataType;
|
|
}
|
|
|
|
/**
|
|
* Gets the context.
|
|
*
|
|
* @return the context
|
|
*/
|
|
public String getContext() {
|
|
return context;
|
|
}
|
|
|
|
/**
|
|
* Gets the measure.
|
|
*
|
|
* @return the measure
|
|
*/
|
|
public long getMeasure() {
|
|
return measure;
|
|
}
|
|
|
|
/**
|
|
* Gets the day.
|
|
*
|
|
* @return the day
|
|
*/
|
|
public Date getDay() {
|
|
return day;
|
|
}
|
|
|
|
/* (non-Javadoc)
|
|
* @see java.lang.Object#toString()
|
|
*/
|
|
@Override
|
|
public String toString() {
|
|
|
|
StringBuilder builder = new StringBuilder();
|
|
builder.append("HarvestedData [dataType=");
|
|
builder.append(dataType);
|
|
builder.append(", context=");
|
|
builder.append(context);
|
|
builder.append(", measure=");
|
|
builder.append(measure);
|
|
builder.append(", day=");
|
|
builder.append(day);
|
|
builder.append(", harvestedDataKey=");
|
|
builder.append(harvestedDataKey);
|
|
builder.append("]");
|
|
return builder.toString();
|
|
}
|
|
|
|
} |