2022-09-22 15:50:39 +02:00
|
|
|
|
2022-08-03 11:42:56 +02:00
|
|
|
package eu.dnetlib.dhp.oa.model;
|
|
|
|
|
2022-09-22 15:50:39 +02:00
|
|
|
import java.io.Serializable;
|
|
|
|
|
2022-08-03 12:25:32 +02:00
|
|
|
import org.apache.commons.lang3.StringUtils;
|
2022-08-03 11:42:56 +02:00
|
|
|
|
2022-09-22 15:50:39 +02:00
|
|
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
|
|
import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema;
|
2022-08-03 11:42:56 +02:00
|
|
|
|
2022-08-03 12:25:32 +02:00
|
|
|
/**
|
|
|
|
* @author miriam.baglioni
|
|
|
|
* @Date 03/08/22
|
|
|
|
*/
|
|
|
|
public class Measure implements Serializable {
|
2022-09-22 15:50:39 +02:00
|
|
|
@JsonSchema(description = "The measure (i.e. class)")
|
|
|
|
private String key;
|
|
|
|
|
|
|
|
@JsonSchema(description = "The value for that measure")
|
|
|
|
private String value;
|
|
|
|
|
|
|
|
public String getKey() {
|
|
|
|
return key;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setKey(String key) {
|
|
|
|
this.key = key;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getValue() {
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setValue(String value) {
|
|
|
|
this.value = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static Measure newInstance(String key, String value) {
|
|
|
|
Measure mes = new Measure();
|
|
|
|
mes.key = key;
|
|
|
|
mes.value = value;
|
|
|
|
return mes;
|
|
|
|
}
|
|
|
|
|
|
|
|
@JsonIgnore
|
|
|
|
public boolean isBlank() {
|
|
|
|
return StringUtils.isBlank(key) && StringUtils.isBlank(value);
|
|
|
|
}
|
2022-08-03 11:42:56 +02:00
|
|
|
}
|