use of org.isotc211.x2005.gmd.CITelephoneType in project arctic-sea by 52North.
the class Iso19139GmdEncoder method encodePhone.
private void encodePhone(CITelephonePropertyType citpt, Referenceable<CiTelephone> referenceable) {
if (referenceable.isReference()) {
Reference reference = referenceable.getReference();
reference.getActuate().map(Actuate::toString).map(ActuateType.Enum::forString).ifPresent(citpt::setActuate);
reference.getArcrole().ifPresent(citpt::setArcrole);
reference.getHref().map(URI::toString).ifPresent(citpt::setHref);
reference.getRole().ifPresent(citpt::setRole);
reference.getShow().map(Show::toString).map(ShowType.Enum::forString).ifPresent(citpt::setShow);
reference.getTitle().ifPresent(citpt::setTitle);
reference.getType().map(Type::toString).map(TypeType.Enum::forString).ifPresent(citpt::setType);
} else {
if (referenceable.isInstance()) {
Nillable<CiTelephone> nillable = referenceable.getInstance();
if (nillable.isPresent()) {
CiTelephone ciTelephone = referenceable.getInstance().get();
CITelephoneType citt = citpt.addNewCITelephone();
if (ciTelephone.isSetVoice()) {
citt.setVoiceArray(listToCharacterStringPropertyTypeArray(ciTelephone.getVoice()));
}
if (ciTelephone.isSetFacsimile()) {
citt.setFacsimileArray(listToCharacterStringPropertyTypeArray(ciTelephone.getFacsimile()));
}
if (ciTelephone.isSetId()) {
citt.setId(ciTelephone.getId());
}
if (ciTelephone.isSetUuid()) {
citt.setUuid(ciTelephone.getUuid());
}
} else {
if (nillable.hasReason()) {
citpt.setNilReason(nillable.getNilReason().get());
}
}
}
}
}
Aggregations