use of eu.europa.ec.inspire.schemas.omso.x30.CategoricalTimeLocationValueTripleType in project arctic-sea by 52North.
the class AbstractTimeLocationValueTripleTypeEncoder method createCategoricalTimeLocationValueTripleType.
/**
* Create a {@link CategoricalTimeLocationValueTripleType} from
* {@link TimeLocationValueTriple}
*
* @param timeLocationValueTriple
* The {@link TimeLocationValueTriple} to encode
* @return The encoded {@link TimeLocationValueTriple}
* @throws EncodingException
* If an error occurs
*/
private TimeValuePairType createCategoricalTimeLocationValueTripleType(TimeLocationValueTriple timeLocationValueTriple) throws EncodingException {
CategoricalTimeLocationValueTripleType ctlvtt = CategoricalTimeLocationValueTripleType.Factory.newInstance();
ctlvtt.addNewTime().setStringValue(getTimeString(timeLocationValueTriple.getTime()));
ctlvtt.addNewLocation().addNewPoint().set(encodeGML(timeLocationValueTriple.getLocation()));
if (timeLocationValueTriple.getValue() instanceof CategoryValue) {
CategoryValue categoryValue = (CategoryValue) timeLocationValueTriple.getValue();
if (categoryValue.isSetValue()) {
ctlvtt.addNewValue().addNewCategory().set(encodeSweCommon(convertToSweCategory(categoryValue)));
} else {
ctlvtt.addNewValue().setNil();
ctlvtt.addNewMetadata().addNewTVPMetadata().addNewNilReason().setNilReason(MISSING);
}
}
return ctlvtt;
}
Aggregations