use of org.n52.shetland.ogc.ows.OwsDomainMetadata in project arctic-sea by 52North.
the class AbstractCapabilitiesBaseTypeDecoder method parseDomain.
private OwsDomain parseDomain(DomainType domain) {
if (domain == null) {
return null;
}
OwsValue defaultValue = parseValue(domain.getDefaultValue());
Collection<OwsMetadata> metadata = parseMetadata(domain.getMetadataArray());
OwsDomainMetadata meaning = parseDomainMetadata(domain.getMeaning());
OwsDomainMetadata dataType = parseDomainMetadata(domain.getDataType());
OwsValuesUnit valuesUnit = Stream.of(parseUom(domain.getUOM()), parseReferenceSystem(domain.getReferenceSystem())).filter(Objects::nonNull).findFirst().orElse(null);
OwsPossibleValues possibleValues = Stream.of(parseAnyValue(domain.getAnyValue()), parseAllowedValues(domain.getAllowedValues()), parseValuesReference(domain.getValuesReference()), parseNoValues(domain.getNoValues())).filter(Objects::nonNull).findFirst().orElse(null);
return new OwsDomain(domain.getName(), possibleValues, defaultValue, meaning, dataType, valuesUnit, metadata);
}
use of org.n52.shetland.ogc.ows.OwsDomainMetadata in project arctic-sea by 52North.
the class AbstractCapabilitiesBaseTypeDecoder method parseMetadata.
// private Set<OwsDomainMetadata> parseDomainMetadata(DomainMetadataType[]
// metadata) {
// return
// Optional.ofNullable(metadata).map(Arrays::stream).orElseGet(Stream::empty).map(this::parseDomainMetadata)
// .filter(Objects::nonNull).collect(toSet());
// }
private OwsMetadata parseMetadata(MetadataType metadata) {
if (metadata == null) {
return null;
}
URI href = Optional.ofNullable(metadata.getHref()).map(Strings::emptyToNull).map(URI::create).orElse(null);
URI role = Optional.ofNullable(metadata.getRole()).map(Strings::emptyToNull).map(URI::create).orElse(null);
URI arcrole = Optional.ofNullable(metadata.getArcrole()).map(Strings::emptyToNull).map(URI::create).orElse(null);
Show show = Optional.ofNullable(metadata.getShow()).map(Object::toString).map(Show::valueOf).orElse(null);
Actuate actuate = Optional.ofNullable(metadata.getActuate()).map(Object::toString).map(Actuate::valueOf).orElse(null);
URI about = Optional.ofNullable(metadata.getAbout()).map(Strings::emptyToNull).map(URI::create).orElse(null);
String title = metadata.getTitle();
return new OwsMetadata(href, role, arcrole, title, show, actuate, about);
}
use of org.n52.shetland.ogc.ows.OwsDomainMetadata in project arctic-sea by 52North.
the class AbstractCapabilitiesBaseTypeDecoder method parse.
private <T extends OwsDomainMetadata> T parse(BiFunction<URI, String, T> fun, DomainMetadataType metadata) {
if (metadata == null) {
return null;
}
URI reference = Optional.ofNullable(metadata.getReference()).map(Strings::emptyToNull).map(URI::create).orElse(null);
String value = metadata.getStringValue();
return fun.apply(reference, value);
}
Aggregations