1
0
Fork 0

code formatting

This commit is contained in:
Claudio Atzori 2024-11-15 09:16:51 +01:00
parent b95672b420
commit 5f512f510e
1 changed files with 15 additions and 11 deletions

View File

@ -155,10 +155,11 @@ public abstract class AbstractMdRecordToOafMapper {
final Instance instance = prepareInstances(doc, entityInfo, collectedFrom, hostedBy); final Instance instance = prepareInstances(doc, entityInfo, collectedFrom, hostedBy);
if (!Optional.ofNullable(instance.getInstancetype()) if (!Optional
.map(Qualifier::getClassid) .ofNullable(instance.getInstancetype())
.filter(StringUtils::isNotBlank) .map(Qualifier::getClassid)
.isPresent()) { .filter(StringUtils::isNotBlank)
.isPresent()) {
return Lists.newArrayList(); return Lists.newArrayList();
} }
@ -173,13 +174,16 @@ public abstract class AbstractMdRecordToOafMapper {
protected String getResultType(final Instance instance) { protected String getResultType(final Instance instance) {
if (this.vocs.vocabularyExists(ModelConstants.DNET_RESULT_TYPOLOGIES)) { if (this.vocs.vocabularyExists(ModelConstants.DNET_RESULT_TYPOLOGIES)) {
return Optional.ofNullable(instance.getInstancetype()) return Optional
.map(Qualifier::getClassid) .ofNullable(instance.getInstancetype())
.map(instanceType -> Optional .map(Qualifier::getClassid)
.ofNullable(this.vocs.getSynonymAsQualifier(ModelConstants.DNET_RESULT_TYPOLOGIES, instanceType)) .map(
.map(Qualifier::getClassid) instanceType -> Optional
.orElse("0000")) .ofNullable(
.orElse("0000"); this.vocs.getSynonymAsQualifier(ModelConstants.DNET_RESULT_TYPOLOGIES, instanceType))
.map(Qualifier::getClassid)
.orElse("0000"))
.orElse("0000");
} else { } else {
throw new IllegalStateException("Missing vocabulary: " + ModelConstants.DNET_RESULT_TYPOLOGIES); throw new IllegalStateException("Missing vocabulary: " + ModelConstants.DNET_RESULT_TYPOLOGIES);
} }