forked from antonis.lempesis/dnet-hadoop
added Mapping of OriginalDescription
This commit is contained in:
parent
6c32d418ac
commit
2dd9572f41
|
@ -10,7 +10,8 @@ public class OAIProvenance implements Serializable {
|
|||
return originDescription;
|
||||
}
|
||||
|
||||
public void setOriginDescription(OriginDescription originDescription) {
|
||||
public OAIProvenance setOriginDescription(OriginDescription originDescription) {
|
||||
this.originDescription = originDescription;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,55 +22,62 @@ public class OriginDescription implements Serializable {
|
|||
return harvestDate;
|
||||
}
|
||||
|
||||
public void setHarvestDate(String harvestDate) {
|
||||
public OriginDescription setHarvestDate(String harvestDate) {
|
||||
this.harvestDate = harvestDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Boolean getAltered() {
|
||||
return altered;
|
||||
}
|
||||
|
||||
public void setAltered(Boolean altered) {
|
||||
public OriginDescription setAltered(Boolean altered) {
|
||||
this.altered = altered;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBaseURL() {
|
||||
return baseURL;
|
||||
}
|
||||
|
||||
public void setBaseURL(String baseURL) {
|
||||
public OriginDescription setBaseURL(String baseURL) {
|
||||
this.baseURL = baseURL;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIdentifier() {
|
||||
return identifier;
|
||||
}
|
||||
|
||||
public void setIdentifier(String identifier) {
|
||||
public OriginDescription setIdentifier(String identifier) {
|
||||
this.identifier = identifier;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDatestamp() {
|
||||
return datestamp;
|
||||
}
|
||||
|
||||
public void setDatestamp(String datestamp) {
|
||||
public OriginDescription setDatestamp(String datestamp) {
|
||||
this.datestamp = datestamp;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMetadataNamespace() {
|
||||
return metadataNamespace;
|
||||
}
|
||||
|
||||
public void setMetadataNamespace(String metadataNamespace) {
|
||||
public OriginDescription setMetadataNamespace(String metadataNamespace) {
|
||||
this.metadataNamespace = metadataNamespace;
|
||||
return this;
|
||||
}
|
||||
|
||||
public OriginDescription getOriginDescription() {
|
||||
return originDescription;
|
||||
}
|
||||
|
||||
public void setOriginDescription(OriginDescription originDescription) {
|
||||
public OriginDescription setOriginDescription(OriginDescription originDescription) {
|
||||
this.originDescription = originDescription;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,6 +54,26 @@ public class ProtoUtils {
|
|||
.setValue(extraInfo.getValue());
|
||||
}
|
||||
|
||||
|
||||
public static OAIProvenance mapOAIProvenance(FieldTypeProtos.OAIProvenance oaiProvenance) {
|
||||
return new OAIProvenance().setOriginDescription(mapOriginalDescription(oaiProvenance.getOriginDescription()));
|
||||
}
|
||||
|
||||
|
||||
public static OriginDescription mapOriginalDescription(FieldTypeProtos.OAIProvenance.OriginDescription originDescription) {
|
||||
final OriginDescription originDescriptionResult = new OriginDescription()
|
||||
.setHarvestDate(originDescription.getHarvestDate())
|
||||
.setAltered(originDescription.getAltered())
|
||||
.setBaseURL(originDescription.getBaseURL())
|
||||
.setIdentifier(originDescription.getIdentifier())
|
||||
.setDatestamp(originDescription.getDatestamp())
|
||||
.setMetadataNamespace(originDescription.getMetadataNamespace());
|
||||
if (originDescription.hasOriginDescription())
|
||||
originDescriptionResult.setOriginDescription(mapOriginalDescription(originDescription.getOriginDescription()));
|
||||
return originDescriptionResult;
|
||||
|
||||
}
|
||||
|
||||
public static Field<String> mapStringField(FieldTypeProtos.StringField s) {
|
||||
return new Field<String>()
|
||||
.setValue(s.getValue())
|
||||
|
|
Loading…
Reference in New Issue