2020-06-08 15:11:37 +02:00
|
|
|
|
|
|
|
package eu.dnetlib.dhp.schema.dump.oaf;
|
|
|
|
|
2020-06-15 11:06:56 +02:00
|
|
|
import java.io.Serializable;
|
2020-06-08 15:11:37 +02:00
|
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
2020-06-15 11:06:56 +02:00
|
|
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
2020-06-08 15:11:37 +02:00
|
|
|
|
2020-08-13 17:05:06 +02:00
|
|
|
/**
|
2020-08-13 18:23:24 +02:00
|
|
|
* To represent the information described by a key and a value. It has two parameters: - key to store the key (generally
|
|
|
|
* the OpenAIRE id for some entity) - value to store the value (generally the OpenAIRE name for the key)
|
2020-08-13 17:05:06 +02:00
|
|
|
*/
|
2020-06-08 15:11:37 +02:00
|
|
|
public class KeyValue implements Serializable {
|
|
|
|
|
|
|
|
private String key;
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2020-06-15 11:06:56 +02:00
|
|
|
public static KeyValue newInstance(String key, String value) {
|
2020-06-09 15:37:46 +02:00
|
|
|
KeyValue inst = new KeyValue();
|
|
|
|
inst.key = key;
|
|
|
|
inst.value = value;
|
|
|
|
return inst;
|
|
|
|
}
|
2020-06-08 15:11:37 +02:00
|
|
|
|
|
|
|
@JsonIgnore
|
|
|
|
public boolean isBlank() {
|
|
|
|
return StringUtils.isBlank(key) && StringUtils.isBlank(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|