Added PayloadDV

This commit is contained in:
Francesco Mangiacrapa 2022-10-11 10:35:35 +02:00
parent 07ffe5ec37
commit a8b4ae48bc
3 changed files with 96 additions and 14 deletions

View File

@ -51,6 +51,8 @@ import org.gcube.application.geoportalcommon.shared.geoportal.ucd.GEOPORTAL_DATA
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.HandlerDeclarationDV;
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV;
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
import org.gcube.application.geoportalcommon.shared.geoportal.view.Payload;
import org.gcube.application.geoportalcommon.shared.geoportal.view.PayloadDV;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -1132,4 +1134,13 @@ public class ConvertToDataValueObjectModel {
}
public static PayloadDV toPayloadDV(Payload payload) {
PayloadDV p = new PayloadDV();
p.setName(payload.getName());
p.setLink(payload.getLink());
p.setMimetype(payload.getMimetype());
p.setStorageID(p.getStorageID());
return p;
}
}

View File

@ -0,0 +1,83 @@
package org.gcube.application.geoportalcommon.shared.geoportal.view;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlRootElement;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.extern.slf4j.Slf4j;
@XmlRootElement(name = "_payloads")
@Slf4j
public class Payload implements Serializable {
/**
*
*/
private static final long serialVersionUID = -3975356671779455705L;
@JsonProperty("_mimetype")
private String mimetype;
@JsonProperty("_storageID")
private String storageID;
@JsonProperty("_link")
private String link;
@JsonProperty("_name")
private String name;
public Payload() {
}
public String getMimetype() {
return mimetype;
}
public String getStorageID() {
return storageID;
}
public String getLink() {
return link;
}
public String getName() {
return name;
}
public void setMimetype(String mimetype) {
this.mimetype = mimetype;
}
public void setStorageID(String storageID) {
this.storageID = storageID;
}
public void setLink(String link) {
this.link = link;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("Payload [mimetype=");
builder.append(mimetype);
builder.append(", storageID=");
builder.append(storageID);
builder.append(", link=");
builder.append(link);
builder.append(", name=");
builder.append(name);
builder.append("]");
return builder.toString();
}
}

View File

@ -2,31 +2,19 @@ package org.gcube.application.geoportalcommon.shared.geoportal.view;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlRootElement;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.extern.slf4j.Slf4j;
@XmlRootElement(name = "_payloads")
@Slf4j
public class PayloadDV implements Serializable {
/**
*
*/
private static final long serialVersionUID = -3975356671779455705L;
private static final long serialVersionUID = 1364319249658824189L;
@JsonProperty("_mimetype")
private String mimetype;
@JsonProperty("_storageID")
private String storageID;
@JsonProperty("_link")
private String link;
@JsonProperty("_name")
private String name;
public PayloadDV() {
@ -68,7 +56,7 @@ public class PayloadDV implements Serializable {
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("PayloadDV [mimetype=");
builder.append("Payload [mimetype=");
builder.append(mimetype);
builder.append(", storageID=");
builder.append(storageID);