2017-12-12 14:28:26 +01:00
|
|
|
package org.gcube.data_catalogue.grsf_publish_ws.json.input.others;
|
|
|
|
|
|
|
|
import javax.validation.constraints.Size;
|
|
|
|
|
|
|
|
import org.gcube.datacatalogue.common.Constants;
|
|
|
|
import org.json.simple.JSONObject;
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Connected grsf-records bean
|
|
|
|
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
|
|
|
*/
|
|
|
|
public class ConnectedBean {
|
|
|
|
|
|
|
|
@JsonProperty(Constants.CONNECTED_RECORD_SEMANTIC_IDENTIFIER_JSON_KEY)
|
|
|
|
@Size(min=1, message= Constants.CONNECTED_RECORD_SEMANTIC_IDENTIFIER_JSON_KEY + " cannot be empty")
|
|
|
|
private String semanticIdentifier;
|
|
|
|
|
|
|
|
@JsonProperty(Constants.CONNECTED_RECORD_SHORT_NAME_JSON_KEY)
|
|
|
|
private String shortName;
|
|
|
|
|
|
|
|
@JsonProperty(Constants.CONNECTED_RECORD_KNOWLEDGE_BASE_ID_JSON_KEY)
|
|
|
|
@Size(min=1, message= Constants.CONNECTED_RECORD_KNOWLEDGE_BASE_ID_JSON_KEY + " cannot be empty")
|
|
|
|
private String knowledeBaseId;
|
|
|
|
|
2018-01-31 14:28:34 +01:00
|
|
|
// @JsonProperty(Constants.CONNECTED_JSON_KEY)
|
|
|
|
// private boolean connected;
|
2018-01-26 16:52:44 +01:00
|
|
|
|
2017-12-12 14:28:26 +01:00
|
|
|
public ConnectedBean() {
|
|
|
|
super();
|
|
|
|
}
|
|
|
|
|
2018-01-26 16:52:44 +01:00
|
|
|
|
|
|
|
|
2017-12-12 14:28:26 +01:00
|
|
|
/**
|
|
|
|
* @param semanticIdentifier
|
|
|
|
* @param shortName
|
|
|
|
* @param knowledeBaseId
|
2018-01-26 16:52:44 +01:00
|
|
|
* @param connected
|
2017-12-12 14:28:26 +01:00
|
|
|
*/
|
|
|
|
public ConnectedBean(String semanticIdentifier, String shortName,
|
2018-01-26 16:52:44 +01:00
|
|
|
String knowledeBaseId, boolean connected) {
|
2017-12-12 14:28:26 +01:00
|
|
|
super();
|
|
|
|
this.semanticIdentifier = semanticIdentifier;
|
|
|
|
this.shortName = shortName;
|
|
|
|
this.knowledeBaseId = knowledeBaseId;
|
2018-01-31 14:28:34 +01:00
|
|
|
// this.connected = connected;
|
2017-12-12 14:28:26 +01:00
|
|
|
}
|
|
|
|
|
2018-01-31 14:28:34 +01:00
|
|
|
// public boolean isConnected() {
|
|
|
|
// return connected;
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// public void setConnected(boolean connected) {
|
|
|
|
// this.connected = connected;
|
|
|
|
// }
|
2018-01-26 16:52:44 +01:00
|
|
|
|
2017-12-12 14:28:26 +01:00
|
|
|
public String getSemanticIdentifier() {
|
|
|
|
return semanticIdentifier;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setSemanticIdentifier(String semanticIdentifier) {
|
|
|
|
this.semanticIdentifier = semanticIdentifier;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getShortName() {
|
|
|
|
return shortName;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setShortName(String shortName) {
|
|
|
|
this.shortName = shortName;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getKnowledeBaseId() {
|
|
|
|
return knowledeBaseId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setKnowledeBaseId(String knowledeBaseId) {
|
|
|
|
this.knowledeBaseId = knowledeBaseId;
|
|
|
|
}
|
|
|
|
|
2017-12-13 18:35:23 +01:00
|
|
|
@SuppressWarnings("unchecked")
|
2017-12-12 14:28:26 +01:00
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
|
|
|
|
JSONObject obj = new JSONObject();
|
|
|
|
obj.put(Constants.CONNECTED_RECORD_SHORT_NAME_JSON_KEY, shortName);
|
2018-01-26 16:52:44 +01:00
|
|
|
obj.put(Constants.CONNECTED_RECORD_SEMANTIC_IDENTIFIER_JSON_KEY, semanticIdentifier);
|
2017-12-12 14:28:26 +01:00
|
|
|
obj.put(Constants.CONNECTED_RECORD_KNOWLEDGE_BASE_ID_JSON_KEY, knowledeBaseId);
|
2018-01-31 14:28:34 +01:00
|
|
|
// obj.put(Constants.CONNECTED_JSON_KEY, connected);
|
2017-12-12 14:28:26 +01:00
|
|
|
return obj.toJSONString();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|