WIP: pruning out non necessary fields from the internal model

This commit is contained in:
Claudio Atzori 2023-02-02 17:01:22 +01:00
parent 112b5c29ec
commit 57d1b88746
4 changed files with 21 additions and 11 deletions

View File

@ -17,10 +17,10 @@ public class Measure implements Serializable {
private String id;
/**
* List of units associated with this measure. KeyValue provides a pair to store the label (key) and the value, plus
* List of units associated with this measure. MeasureUnit provides a pair to store the label (key) and the value, plus
* common provenance information.
*/
private List<KeyValue> unit;
private List<MeasureUnit> unit;
public String getId() {
return id;
@ -30,18 +30,14 @@ public class Measure implements Serializable {
this.id = id;
}
public List<KeyValue> getUnit() {
public List<MeasureUnit> getUnit() {
return unit;
}
public void setUnit(List<KeyValue> unit) {
public void setUnit(List<MeasureUnit> unit) {
this.unit = unit;
}
public void mergeFrom(Measure m) {
// TODO
}
@Override
public boolean equals(Object o) {
if (this == o)

View File

@ -0,0 +1,14 @@
package eu.dnetlib.dhp.schema.oaf;
public class MeasureUnit extends KeyValue {
private DataInfo dataInfo;
public DataInfo getDataInfo() {
return dataInfo;
}
public void setDataInfo(DataInfo dataInfo) {
this.dataInfo = dataInfo;
}
}

View File

@ -51,7 +51,7 @@ public class Relation extends Oaf implements Serializable {
private String validationDate;
private List<Provenance> provenance;
/**
* List of relation specific properties. Values include 'similarityLevel', indicating the similarity score between a
* pair of publications.

View File

@ -47,8 +47,8 @@ class MeasureTest {
Assertions.assertNotNull(mm);
}
private KeyValue unit(String key, String value) {
KeyValue unit = new KeyValue();
private MeasureUnit unit(String key, String value) {
MeasureUnit unit = new MeasureUnit();
unit.setKey(key);
unit.setValue(value);
return unit;