use of org.n52.shetland.ogc.swe.simpleType.SweAllowedTimes in project arctic-sea by 52North.
the class SweCommonDecoderV101 method parseAllowedTimes.
@SuppressWarnings({ "unchecked", "rawtypes" })
private SweAllowedTimes parseAllowedTimes(AllowedTimes att) throws DateTimeParseException {
SweAllowedTimes allowedTimes = new SweAllowedTimes();
if (att.isSetId()) {
allowedTimes.setGmlId(att.getId());
}
if (CollectionHelper.isNotNullOrEmpty(att.getValueListArray())) {
for (List list : att.getValueListArray()) {
if (CollectionHelper.isNotEmpty(list)) {
for (Object value : list) {
allowedTimes.addValue(DateTimeHelper.parseIsoString2DateTime(value.toString()));
}
}
}
}
if (CollectionHelper.isNotNullOrEmpty(att.getIntervalArray())) {
for (List interval : att.getIntervalArray()) {
RangeValue<DateTime> rangeValue = new RangeValue<DateTime>();
Iterator iterator = interval.iterator();
if (iterator.hasNext()) {
rangeValue.setRangeStart(DateTimeHelper.parseIsoString2DateTime(iterator.next().toString()));
}
if (iterator.hasNext()) {
rangeValue.setRangeEnd(DateTimeHelper.parseIsoString2DateTime(iterator.next().toString()));
}
allowedTimes.addInterval(rangeValue);
}
}
return allowedTimes;
}
use of org.n52.shetland.ogc.swe.simpleType.SweAllowedTimes in project arctic-sea by 52North.
the class SweCommonDecoderV20 method parseAllowedTimes.
@SuppressWarnings("rawtypes")
private SweAllowedTimes parseAllowedTimes(AllowedTimesType att) throws DateTimeParseException {
SweAllowedTimes allowedTimes = new SweAllowedTimes();
if (att.isSetId()) {
allowedTimes.setGmlId(att.getId());
}
if (CollectionHelper.isNotNullOrEmpty(att.getValueArray())) {
for (Object value : att.getValueArray()) {
allowedTimes.addValue(DateTimeHelper.parseIsoString2DateTime(value.toString()));
}
}
if (CollectionHelper.isNotNullOrEmpty(att.getIntervalArray())) {
for (List interval : att.getIntervalArray()) {
RangeValue<DateTime> rangeValue = new RangeValue<DateTime>();
Iterator iterator = interval.iterator();
if (iterator.hasNext()) {
rangeValue.setRangeStart(DateTimeHelper.parseIsoString2DateTime(iterator.next().toString()));
}
if (iterator.hasNext()) {
rangeValue.setRangeEnd(DateTimeHelper.parseIsoString2DateTime(iterator.next().toString()));
}
allowedTimes.addInterval(rangeValue);
}
}
if (att.isSetSignificantFigures()) {
allowedTimes.setSignificantFigures(att.getSignificantFigures());
}
return allowedTimes;
}
Aggregations