Skip to content

Commit

Permalink
java 8 stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanHolstien committed Jan 25, 2024
1 parent da43a6d commit 9196374
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,15 @@ public String getIdentifier() {
private AspectSpec buildAspectSpec(String aspectName, EntitySpecBuilder entitySpecBuilder) {
Optional<DataSchema> aspectSchema = dataSchemaFactory.getAspectSchema(aspectName);
Optional<Class> 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());
}

private EventSpec buildEventSpec(String eventName) {
Optional<DataSchema> 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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ public AspectTemplateEngine getAspectTemplateEngine() {
private AspectSpec buildAspectSpec(String aspectName, EntitySpecBuilder entitySpecBuilder) {
Optional<DataSchema> aspectSchema = dataSchemaFactory.getAspectSchema(aspectName);
Optional<Class> aspectClass = dataSchemaFactory.getAspectClass(aspectName);
if (aspectSchema.isEmpty()) {
if (!aspectSchema.isPresent()) {
throw new IllegalArgumentException(String.format("Aspect %s does not exist", aspectName));
}
AspectSpec aspectSpec =
Expand All @@ -294,7 +294,7 @@ private AspectSpec buildAspectSpec(String aspectName, EntitySpecBuilder entitySp

private EventSpec buildEventSpec(String eventName) {
Optional<DataSchema> 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());
Expand Down

0 comments on commit 9196374

Please sign in to comment.