use of org.n52.shetland.iso.gmd.CiOnlineResource in project arctic-sea by 52North.
the class Iso19139GmdEncoder method encodeOnlineResource.
private void encodeOnlineResource(CIOnlineResourcePropertyType ciorpt, Referenceable<CiOnlineResource> referenceable) {
if (referenceable.isReference()) {
Reference reference = referenceable.getReference();
reference.getActuate().map(Actuate::toString).map(ActuateType.Enum::forString).ifPresent(ciorpt::setActuate);
reference.getArcrole().ifPresent(ciorpt::setArcrole);
reference.getHref().map(URI::toString).ifPresent(ciorpt::setHref);
reference.getRole().ifPresent(ciorpt::setRole);
reference.getShow().map(Show::toString).map(ShowType.Enum::forString).ifPresent(ciorpt::setShow);
reference.getTitle().ifPresent(ciorpt::setTitle);
reference.getType().map(Type::toString).map(TypeType.Enum::forString).ifPresent(ciorpt::setType);
} else {
if (referenceable.isInstance()) {
Nillable<CiOnlineResource> nillable = referenceable.getInstance();
if (nillable.isPresent()) {
CIOnlineResourceType ciort = ciorpt.addNewCIOnlineResource();
encodeOnlineResource(ciort, referenceable.getInstance().get());
} else {
if (nillable.hasReason()) {
ciorpt.setNilReason(nillable.getNilReason().get());
}
}
}
}
}
Aggregations