From 919637403f8b4af89526bd4da6fd52758a65c973 Mon Sep 17 00:00:00 2001 From: Ryan Holstien Date: Thu, 25 Jan 2024 11:11:56 -0600 Subject: [PATCH] java 8 stuff --- .../metadata/models/registry/ConfigEntityRegistry.java | 4 ++-- .../metadata/models/registry/PatchEntityRegistry.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/entity-registry/src/main/java/com/linkedin/metadata/models/registry/ConfigEntityRegistry.java b/entity-registry/src/main/java/com/linkedin/metadata/models/registry/ConfigEntityRegistry.java index 969b6587a2eeb..9aed29ab8595e 100644 --- a/entity-registry/src/main/java/com/linkedin/metadata/models/registry/ConfigEntityRegistry.java +++ b/entity-registry/src/main/java/com/linkedin/metadata/models/registry/ConfigEntityRegistry.java @@ -189,7 +189,7 @@ public String getIdentifier() { private AspectSpec buildAspectSpec(String aspectName, EntitySpecBuilder entitySpecBuilder) { Optional aspectSchema = dataSchemaFactory.getAspectSchema(aspectName); Optional aspectClass = dataSchemaFactory.getAspectClass(aspectName); - if (aspectSchema.isEmpty()) { + if (!aspectSchema.isPresent()) { throw new IllegalArgumentException(String.format("Aspect %s does not exist", aspectName)); } return entitySpecBuilder.buildAspectSpec(aspectSchema.get(), aspectClass.get()); @@ -197,7 +197,7 @@ private AspectSpec buildAspectSpec(String aspectName, EntitySpecBuilder entitySp private EventSpec buildEventSpec(String eventName) { Optional eventSchema = dataSchemaFactory.getEventSchema(eventName); - if (eventSchema.isEmpty()) { + if (!eventSchema.isPresent()) { throw new IllegalArgumentException(String.format("Event %s does not exist", eventName)); } return new EventSpecBuilder().buildEventSpec(eventName, eventSchema.get()); diff --git a/entity-registry/src/main/java/com/linkedin/metadata/models/registry/PatchEntityRegistry.java b/entity-registry/src/main/java/com/linkedin/metadata/models/registry/PatchEntityRegistry.java index 59309e255a906..b4fc4193e7263 100644 --- a/entity-registry/src/main/java/com/linkedin/metadata/models/registry/PatchEntityRegistry.java +++ b/entity-registry/src/main/java/com/linkedin/metadata/models/registry/PatchEntityRegistry.java @@ -282,7 +282,7 @@ public AspectTemplateEngine getAspectTemplateEngine() { private AspectSpec buildAspectSpec(String aspectName, EntitySpecBuilder entitySpecBuilder) { Optional aspectSchema = dataSchemaFactory.getAspectSchema(aspectName); Optional aspectClass = dataSchemaFactory.getAspectClass(aspectName); - if (aspectSchema.isEmpty()) { + if (!aspectSchema.isPresent()) { throw new IllegalArgumentException(String.format("Aspect %s does not exist", aspectName)); } AspectSpec aspectSpec = @@ -294,7 +294,7 @@ private AspectSpec buildAspectSpec(String aspectName, EntitySpecBuilder entitySp private EventSpec buildEventSpec(String eventName) { Optional eventSchema = dataSchemaFactory.getEventSchema(eventName); - if (eventSchema.isEmpty()) { + if (!eventSchema.isPresent()) { throw new IllegalArgumentException(String.format("Event %s does not exist", eventName)); } return new EventSpecBuilder().buildEventSpec(eventName, eventSchema.get());