From e2796f27a6c124a1d19e7f56590c7be1c27cdb89 Mon Sep 17 00:00:00 2001 From: Jalander Ramagiri Date: Wed, 10 Jan 2024 10:34:10 +0000 Subject: [PATCH] Java SDK tests against examples from the spec repo Signed-off-by: Jalander Ramagiri --- generator/pom.xml | 80 +- sdk/src/main/java/dev/cdevents/CDEvents.java | 95 +- .../cdevents/constants/CDEventConstants.java | 117 +- .../models/artifact/packaged/Content.java | 19 + .../models/artifact/packaged/Context.java | 23 + .../models/artifact/packaged/Subject.java | 22 + .../models/artifact/published/Context.java | 23 + .../models/artifact/published/Subject.java | 22 + .../artifact/signed/Artifactsigned.java | 22 + .../models/artifact/signed/Content.java | 19 + .../models/artifact/signed/Context.java | 23 + .../models/artifact/signed/Subject.java | 22 + .../models/branch/created/Content.java | 19 + .../models/branch/created/Context.java | 23 + .../models/branch/created/Subject.java | 22 + .../models/branch/deleted/Content.java | 19 + .../models/branch/deleted/Context.java | 23 + .../models/branch/deleted/Subject.java | 22 + .../models/build/finished/Buildfinished.java | 22 + .../models/build/finished/Content.java | 19 + .../models/build/finished/Context.java | 23 + .../models/build/finished/Subject.java | 22 + .../models/build/queued/Buildqueued.java | 22 + .../cdevents/models/build/queued/Context.java | 23 + .../cdevents/models/build/queued/Subject.java | 22 + .../models/build/started/Buildstarted.java | 22 + .../models/build/started/Context.java | 23 + .../models/build/started/Subject.java | 22 + .../change/abandoned/Changeabandoned.java | 22 + .../models/change/abandoned/Content.java | 19 + .../models/change/abandoned/Context.java | 23 + .../models/change/abandoned/Subject.java | 22 + .../models/change/created/Changecreated.java | 22 + .../models/change/created/Content.java | 19 + .../models/change/created/Context.java | 23 + .../models/change/created/Repository.java | 20 + .../models/change/created/Subject.java | 22 + .../models/change/merged/Changemerged.java | 22 + .../models/change/merged/Content.java | 19 + .../models/change/merged/Context.java | 23 + .../models/change/merged/Repository.java | 20 + .../models/change/merged/Subject.java | 22 + .../change/reviewed/Changereviewed.java | 22 + .../models/change/reviewed/Content.java | 19 + .../models/change/reviewed/Context.java | 23 + .../models/change/reviewed/Repository.java | 20 + .../models/change/reviewed/Subject.java | 22 + .../models/change/updated/Changeupdated.java | 22 + .../models/change/updated/Content.java | 19 + .../models/change/updated/Context.java | 23 + .../models/change/updated/Repository.java | 20 + .../models/change/updated/Subject.java | 22 + .../models/environment/created/Content.java | 20 + .../models/environment/created/Context.java | 23 + .../created/Environmentcreated.java | 22 + .../models/environment/created/Subject.java | 22 + .../models/environment/deleted/Content.java | 19 + .../models/environment/deleted/Context.java | 23 + .../deleted/Environmentdeleted.java | 22 + .../models/environment/deleted/Subject.java | 22 + .../models/environment/modified/Content.java | 20 + .../models/environment/modified/Context.java | 23 + .../modified/Environmentmodified.java | 22 + .../models/environment/modified/Subject.java | 22 + .../models/incident/detected/Content.java | 22 + .../models/incident/detected/Context.java | 23 + .../models/incident/detected/Subject.java | 22 + .../models/incident/reported/Content.java | 23 + .../models/incident/reported/Context.java | 23 + .../models/incident/reported/Subject.java | 22 + .../models/incident/resolved/Content.java | 22 + .../models/incident/resolved/Context.java | 23 + .../models/incident/resolved/Environment.java | 20 + .../models/incident/resolved/Service.java | 20 + .../models/incident/resolved/Subject.java | 22 + .../models/pipelinerun/finished/Content.java | 22 + .../models/pipelinerun/finished/Context.java | 23 + .../finished/Pipelinerunfinished.java | 22 + .../models/pipelinerun/finished/Subject.java | 22 + .../models/pipelinerun/queued/Content.java | 20 + .../models/pipelinerun/queued/Context.java | 23 + .../pipelinerun/queued/Pipelinerunqueued.java | 22 + .../models/pipelinerun/queued/Subject.java | 22 + .../models/pipelinerun/started/Content.java | 20 + .../models/pipelinerun/started/Context.java | 23 + .../started/Pipelinerunstarted.java | 22 + .../models/pipelinerun/started/Subject.java | 22 + .../models/repository/created/Content.java | 22 + .../models/repository/created/Context.java | 23 + .../repository/created/Repositorycreated.java | 22 + .../models/repository/created/Subject.java | 22 + .../models/repository/deleted/Content.java | 22 + .../models/repository/deleted/Context.java | 23 + .../repository/deleted/Repositorydeleted.java | 22 + .../models/repository/deleted/Subject.java | 22 + .../models/repository/modified/Content.java | 22 + .../models/repository/modified/Context.java | 23 + .../modified/Repositorymodified.java | 22 + .../models/repository/modified/Subject.java | 22 + .../models/service/deployed/Content.java | 20 + .../models/service/deployed/Context.java | 23 + .../models/service/deployed/Environment.java | 20 + .../service/deployed/Servicedeployed.java | 22 + .../models/service/deployed/Subject.java | 22 + .../models/service/published/Content.java | 19 + .../models/service/published/Context.java | 23 + .../models/service/published/Environment.java | 20 + .../service/published/Servicepublished.java | 22 + .../models/service/published/Subject.java | 22 + .../models/service/removed/Content.java | 19 + .../models/service/removed/Context.java | 23 + .../models/service/removed/Environment.java | 20 + .../service/removed/Serviceremoved.java | 22 + .../models/service/removed/Subject.java | 22 + .../models/service/rolledback/Content.java | 20 + .../models/service/rolledback/Context.java | 23 + .../service/rolledback/Environment.java | 20 + .../service/rolledback/Servicerolledback.java | 22 + .../models/service/rolledback/Subject.java | 22 + .../models/service/upgraded/Content.java | 20 + .../models/service/upgraded/Context.java | 23 + .../models/service/upgraded/Environment.java | 20 + .../service/upgraded/Serviceupgraded.java | 22 + .../models/service/upgraded/Subject.java | 22 + .../models/taskrun/finished/Content.java | 23 + .../models/taskrun/finished/Context.java | 23 + .../models/taskrun/finished/PipelineRun.java | 20 + .../models/taskrun/finished/Subject.java | 22 + .../taskrun/finished/Taskrunfinished.java | 22 + .../models/taskrun/started/Content.java | 21 + .../models/taskrun/started/Context.java | 23 + .../models/taskrun/started/PipelineRun.java | 20 + .../models/taskrun/started/Subject.java | 22 + .../taskrun/started/Taskrunstarted.java | 22 + .../models/testcaserun/finished/Content.java | 24 + .../models/testcaserun/finished/Context.java | 23 + .../testcaserun/finished/Environment.java | 20 + .../models/testcaserun/finished/Subject.java | 22 + .../models/testcaserun/finished/TestCase.java | 23 + .../testcaserun/finished/TestSuiteRun.java | 20 + .../finished/Testcaserunfinished.java | 22 + .../models/testcaserun/queued/Content.java | 22 + .../models/testcaserun/queued/Context.java | 23 + .../testcaserun/queued/Environment.java | 20 + .../models/testcaserun/queued/Subject.java | 22 + .../models/testcaserun/queued/TestCase.java | 23 + .../testcaserun/queued/TestSuiteRun.java | 20 + .../models/testcaserun/queued/Trigger.java | 21 + .../models/testcaserun/started/Content.java | 22 + .../models/testcaserun/started/Context.java | 23 + .../testcaserun/started/Environment.java | 20 + .../models/testcaserun/started/Subject.java | 22 + .../models/testcaserun/started/TestCase.java | 23 + .../testcaserun/started/TestSuiteRun.java | 20 + .../started/Testcaserunstarted.java | 22 + .../models/testcaserun/started/Trigger.java | 21 + .../models/testoutput/published/Content.java | 22 + .../models/testoutput/published/Context.java | 23 + .../models/testoutput/published/Subject.java | 22 + .../testoutput/published/TestCaseRun.java | 20 + .../published/Testoutputpublished.java | 22 + .../models/testsuiterun/finished/Content.java | 23 + .../models/testsuiterun/finished/Context.java | 23 + .../testsuiterun/finished/Environment.java | 20 + .../models/testsuiterun/finished/Subject.java | 22 + .../testsuiterun/finished/TestSuite.java | 22 + .../finished/Testsuiterunfinished.java | 22 + .../models/testsuiterun/queued/Content.java | 21 + .../models/testsuiterun/queued/Context.java | 23 + .../testsuiterun/queued/Environment.java | 20 + .../models/testsuiterun/queued/Subject.java | 22 + .../models/testsuiterun/queued/TestSuite.java | 22 + .../queued/Testsuiterunqueued.java | 22 + .../models/testsuiterun/queued/Trigger.java | 21 + .../models/testsuiterun/started/Content.java | 21 + .../models/testsuiterun/started/Context.java | 23 + .../testsuiterun/started/Environment.java | 20 + .../models/testsuiterun/started/Subject.java | 22 + .../testsuiterun/started/TestSuite.java | 22 + .../started/Testsuiterunstarted.java | 22 + .../models/testsuiterun/started/Trigger.java | 21 + .../cdevents/CDEventsSpecExamplesTest.java | 1026 +++++++++++++++++ .../test/java/dev/cdevents/CDEventsTest.java | 42 +- .../artifact_packaged_with_no_content.json | 14 + .../artifact_published_with_no_context.json | 8 + .../artifact_signed_with_invalid_type.json | 17 + 186 files changed, 5169 insertions(+), 87 deletions(-) create mode 100644 sdk/src/test/java/dev/cdevents/CDEventsSpecExamplesTest.java create mode 100644 sdk/src/test/resources/artifact_packaged_with_no_content.json create mode 100644 sdk/src/test/resources/artifact_published_with_no_context.json create mode 100644 sdk/src/test/resources/artifact_signed_with_invalid_type.json diff --git a/generator/pom.xml b/generator/pom.xml index e677e69..5dab43a 100644 --- a/generator/pom.xml +++ b/generator/pom.xml @@ -72,7 +72,7 @@ 1.2.1 ${sdk.project.dir}/src/main/java - false + true false false @@ -89,7 +89,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.artifact.packaged - false + true false @@ -105,7 +105,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.artifact.published - false + true false @@ -121,7 +121,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.artifact.signed - false + true false @@ -137,7 +137,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.branch.created - false + true false @@ -153,7 +153,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.branch.deleted - false + true false @@ -169,7 +169,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.build.finished - false + true false @@ -185,7 +185,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.build.queued - false + true false @@ -201,7 +201,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.build.started - false + true false @@ -217,7 +217,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.change.abandoned - false + true false @@ -233,7 +233,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.change.created - false + true false @@ -249,7 +249,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.change.merged - false + true false @@ -265,7 +265,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.change.reviewed - false + true false @@ -281,7 +281,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.change.updated - false + true false @@ -297,7 +297,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.environment.created - false + true false @@ -313,7 +313,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.environment.deleted - false + true false @@ -329,7 +329,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.environment.modified - false + true false @@ -345,7 +345,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.incident.detected - false + true false @@ -361,7 +361,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.incident.reported - false + true false @@ -377,7 +377,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.incident.resolved - false + true false @@ -393,7 +393,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.pipelinerun.finished - false + true false @@ -409,7 +409,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.pipelinerun.queued - false + true false @@ -425,7 +425,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.pipelinerun.started - false + true false @@ -441,7 +441,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.repository.created - false + true false @@ -457,7 +457,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.repository.deleted - false + true false @@ -473,7 +473,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.repository.modified - false + true false @@ -489,7 +489,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.service.deployed - false + true false @@ -505,7 +505,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.service.published - false + true false @@ -521,7 +521,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.service.removed - false + true false @@ -537,7 +537,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.service.rolledback - false + true false @@ -553,7 +553,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.service.upgraded - false + true false @@ -569,7 +569,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.taskrun.finished - false + true false @@ -585,7 +585,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.taskrun.started - false + true false @@ -601,7 +601,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.testcaserun.finished - false + true false @@ -617,7 +617,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.testcaserun.queued - false + true false @@ -633,7 +633,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.testcaserun.started - false + true false @@ -649,7 +649,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.testoutput.published - false + true false @@ -665,7 +665,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.testsuiterun.finished - false + true false @@ -681,7 +681,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.testsuiterun.queued - false + true false @@ -697,7 +697,7 @@ ${sdk.project.dir}/src/main/java dev.cdevents.models.testsuiterun.started - false + true false diff --git a/sdk/src/main/java/dev/cdevents/CDEvents.java b/sdk/src/main/java/dev/cdevents/CDEvents.java index d4ebd30..ce857c6 100644 --- a/sdk/src/main/java/dev/cdevents/CDEvents.java +++ b/sdk/src/main/java/dev/cdevents/CDEvents.java @@ -9,6 +9,7 @@ import com.networknt.schema.SpecVersion; import com.networknt.schema.ValidationMessage; import dev.cdevents.config.CustomObjectMapper; +import dev.cdevents.constants.CDEventConstants; import dev.cdevents.exception.CDEventsException; import dev.cdevents.models.CDEvent; import io.cloudevents.CloudEvent; @@ -20,6 +21,7 @@ import java.net.URISyntaxException; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; +import java.util.Arrays; import java.util.Set; import java.util.UUID; @@ -77,11 +79,7 @@ public static CloudEvent cdEventAsCloudEvent(CDEvent cdEvent) { * @return valid cdEvent */ public static boolean validateCDEvent(CDEvent cdEvent) { - JsonSchemaFactory factory = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V202012); - JsonSchema jsonSchema = factory.getSchema(cdEvent.eventSchema()); - - JsonNode jsonNode = objectMapper.convertValue(cdEvent, ObjectNode.class); - Set errors = jsonSchema.validate(jsonNode); + Set errors = getJsonSchemaValidationMessages(cdEvent); if (!errors.isEmpty()) { log.error("CDEvent validation failed with errors {}", errors); @@ -90,4 +88,91 @@ public static boolean validateCDEvent(CDEvent cdEvent) { return true; } + /** + * Creates cdEvent from cdEventJson string and validates against schema. + * @param cdEventJson + * @return CDEvent, needs type casting to specific CDEvent class + */ + public static CDEvent cdEventFromJson(String cdEventJson) { + if (!validateCDEventJson(cdEventJson)) { + throw new CDEventsException("CDEvent Json validation failed against schema"); + } + String eventType = getUnVersionedEventTypeFromJson(cdEventJson); + CDEventConstants.CDEventTypes cdEventType = getCDEventTypeEnum(eventType); + try { + CDEvent cdEvent = (CDEvent) new ObjectMapper().readValue(cdEventJson, cdEventType.getEventClass()); + return cdEvent; + } catch (JsonProcessingException e) { + log.error("Exception occurred while creating CDEvent from json {}", cdEventJson); + throw new CDEventsException("Exception occurred while creating CDEvent from json ", e); + } + } + + /** + * Validates the cdEventJson against the Schema URL. + * @param cdEventJson + * @return true, If cdEventJson is valid + */ + public static boolean validateCDEventJson(String cdEventJson) { + String eventType = getUnVersionedEventTypeFromJson(cdEventJson); + CDEventConstants.CDEventTypes cdEventType = getCDEventTypeEnum(eventType); + try { + CDEvent cdEvent = (CDEvent) new ObjectMapper().readValue(cdEventJson, cdEventType.getEventClass()); + Set errors = getJsonSchemaValidationMessages(cdEvent); + + if (!errors.isEmpty()) { + log.error("CDEvent Json validation failed against schema URL {}", cdEvent.schemaURL()); + log.error("CDEvent Json validation failed with errors {}", errors); + return false; + } + } catch (JsonProcessingException e) { + throw new CDEventsException("Exception occurred while validating CDEvent json with schema file ", e); + } + return true; + } + + private static Set getJsonSchemaValidationMessages(CDEvent cdEvent) { + JsonSchemaFactory factory = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V202012); + JsonSchema jsonSchema = factory.getSchema(cdEvent.eventSchema()); + + JsonNode jsonNode = objectMapper.convertValue(cdEvent, ObjectNode.class); + Set errors = jsonSchema.validate(jsonNode); + return errors; + } + + private static CDEventConstants.CDEventTypes getCDEventTypeEnum(String eventType) { + return Arrays.stream(CDEventConstants.CDEventTypes.values()) + .filter(type -> eventType.equals(type.getEventType())) + .findFirst() + .orElseThrow( + () -> { + log.error("Invalid CDEvent type found {} from cdEventJson", eventType); + return new CDEventsException("Invalid CDEvent type found from cdEventJson"); + } + ); + } + + private static String getUnVersionedEventTypeFromJson(String cdEventJson) { + String unVersionedEventType = ""; + try { + JsonNode rootNode = objectMapper.readTree(cdEventJson); + if (rootNode.get("context") != null && rootNode.get("context").get("type") != null) { + String versionedEventType = rootNode.get("context").get("type").asText(); + if (versionedEventType.startsWith(CDEventConstants.EVENT_PREFIX)) { + String[] type = versionedEventType.split("\\."); + String subject = type[CDEventConstants.EVENT_SUBJECT_INDEX]; + String predicate = type[CDEventConstants.EVENT_PREDICATE_INDEX]; + unVersionedEventType = CDEventConstants.EVENT_PREFIX + subject + "." + predicate + "."; + } else { + throw new CDEventsException("Invalid CDEvent type found in CDEvent Json " + versionedEventType); + } + } else { + throw new CDEventsException("Unable to find context and type in CDEvent Json"); + } + return unVersionedEventType; + } catch (JsonProcessingException e) { + throw new CDEventsException("Exception occurred while reading CDEvent Json for eventType ", e); + } + + } } diff --git a/sdk/src/main/java/dev/cdevents/constants/CDEventConstants.java b/sdk/src/main/java/dev/cdevents/constants/CDEventConstants.java index 2cc007a..0134f9c 100644 --- a/sdk/src/main/java/dev/cdevents/constants/CDEventConstants.java +++ b/sdk/src/main/java/dev/cdevents/constants/CDEventConstants.java @@ -1,5 +1,7 @@ package dev.cdevents.constants; +import dev.cdevents.events.*; + import java.io.File; public final class CDEventConstants { @@ -7,16 +9,34 @@ public final class CDEventConstants { private CDEventConstants() { } + /** + * Spec repo location. + */ + public static final String SPEC_REPO = ".." + File.separator + "spec"; + /** * Event JsonSchema files location. */ - public static final String SCHEMA_FOLDER = ".." + File.separator + "spec" + File.separator + "schemas"; + public static final String SCHEMA_FOLDER = SPEC_REPO + File.separator + "schemas"; /** * CDEvents Version. */ public static final String CDEVENTS_SPEC_VERSION = "0.3.0"; + /** + * CDEvent type prefix. + */ + public static final String EVENT_PREFIX = "dev.cdevents."; + /** + * CDEvent type subject index. + */ + public static final int EVENT_SUBJECT_INDEX = 2; + /** + * CDEvent type predicate index. + */ + public static final int EVENT_PREDICATE_INDEX = 3; + public enum Outcome { /** * Outcome Success. @@ -61,181 +81,181 @@ public enum CDEventTypes { /** * Pipeline run started event. */ - PipelineRunStartedEvent("dev.cdevents.pipelinerun.started."), + PipelineRunStartedEvent("dev.cdevents.pipelinerun.started.", PipelinerunStartedCDEvent.class), /** * Pipeline run finished event. */ - PipelineRunFinishedEvent("dev.cdevents.pipelinerun.finished."), + PipelineRunFinishedEvent("dev.cdevents.pipelinerun.finished.", PipelinerunFinishedCDEvent.class), /** * Pipeline run queued event. */ - PipelineRunQueuedEvent("dev.cdevents.pipelinerun.queued."), + PipelineRunQueuedEvent("dev.cdevents.pipelinerun.queued.", PipelinerunQueuedCDEvent.class), /* TaskRun events */ /** * Task run started event. */ - TaskRunStartedEvent("dev.cdevents.taskrun.started."), + TaskRunStartedEvent("dev.cdevents.taskrun.started.", TaskrunStartedCDEvent.class), /** * Task run finished event. */ - TaskRunFinishedEvent("dev.cdevents.taskrun.finished."), + TaskRunFinishedEvent("dev.cdevents.taskrun.finished.", TaskrunFinishedCDEvent.class), /* Repository events */ /** * Repository created event. */ - RepositoryCreatedEvent("dev.cdevents.repository.created."), + RepositoryCreatedEvent("dev.cdevents.repository.created.", RepositoryCreatedCDEvent.class), /** * Repository modified event. */ - RepositoryModifiedEvent("dev.cdevents.repository.modified."), + RepositoryModifiedEvent("dev.cdevents.repository.modified.", RepositoryModifiedCDEvent.class), /** * Repository deleted event. */ - RepositoryDeletedEvent("dev.cdevents.repository.deleted."), + RepositoryDeletedEvent("dev.cdevents.repository.deleted.", RepositoryDeletedCDEvent.class), /** * Repository branch created event. */ - BranchCreatedEvent("dev.cdevents.branch.created."), + BranchCreatedEvent("dev.cdevents.branch.created.", BranchCreatedCDEvent.class), /** * Repository branch deleted event. */ - BranchDeletedEvent("dev.cdevents.branch.deleted."), + BranchDeletedEvent("dev.cdevents.branch.deleted.", BranchDeletedCDEvent.class), /* Repository change Events */ /** * Repository change created event. */ - ChangeCreatedEvent("dev.cdevents.change.created."), + ChangeCreatedEvent("dev.cdevents.change.created.", ChangeCreatedCDEvent.class), /** * Repository change updated event. */ - ChangeUpdatedEvent("dev.cdevents.change.updated."), + ChangeUpdatedEvent("dev.cdevents.change.updated.", ChangeUpdatedCDEvent.class), /** * Repository change reviewed event. */ - ChangeReviewedEvent("dev.cdevents.change.reviewed."), + ChangeReviewedEvent("dev.cdevents.change.reviewed.", ChangeReviewedCDEvent.class), /** * Repository change merged event. */ - ChangeMergedEvent("dev.cdevents.change.merged."), + ChangeMergedEvent("dev.cdevents.change.merged.", ChangeMergedCDEvent.class), /** * Repository change abandoned event. */ - ChangeAbandonedEvent("dev.cdevents.change.abandoned."), + ChangeAbandonedEvent("dev.cdevents.change.abandoned.", ChangeAbandonedCDEvent.class), /* Build Events */ /** * Build started event. */ - BuildStartedEvent("dev.cdevents.build.started."), + BuildStartedEvent("dev.cdevents.build.started.", BuildStartedCDEvent.class), /** * Build queued event. */ - BuildQueuedEvent("dev.cdevents.build.queued."), + BuildQueuedEvent("dev.cdevents.build.queued.", BuildQueuedCDEvent.class), /** * Build finished event. */ - BuildFinishedEvent("dev.cdevents.build.finished."), + BuildFinishedEvent("dev.cdevents.build.finished.", BuildFinishedCDEvent.class), /* Test Events */ /** * TestCaseRun started event. */ - TestCaseRunStartedEvent("dev.cdevents.testcaserun.started."), + TestCaseRunStartedEvent("dev.cdevents.testcaserun.started.", TestcaserunStartedCDEvent.class), /** * TestCaseRun queued event. */ - TestCaseRunQueuedEvent("dev.cdevents.testcaserun.queued."), + TestCaseRunQueuedEvent("dev.cdevents.testcaserun.queued.", TestcaserunQueuedCDEvent.class), /** * TestCaseRun finished event. */ - TestCaseRunFinishedEvent("dev.cdevents.testcaserun.finished."), + TestCaseRunFinishedEvent("dev.cdevents.testcaserun.finished.", TestcaserunFinishedCDEvent.class), /** * TestSuiteRun started event. */ - TestSuiteRunStartedEvent("dev.cdevents.testsuiterun.started."), + TestSuiteRunStartedEvent("dev.cdevents.testsuiterun.started.", TestsuiterunStartedCDEvent.class), /** * TestSuiteRun queued event. */ - TestSuiteRunQueuedEvent("dev.cdevents.testsuiterun.queued."), + TestSuiteRunQueuedEvent("dev.cdevents.testsuiterun.queued.", TestsuiterunQueuedCDEvent.class), /** * TestSuiteRun finished event. */ - TestSuiteRunFinishedEvent("dev.cdevents.testsuiterun.finished."), + TestSuiteRunFinishedEvent("dev.cdevents.testsuiterun.finished.", TestsuiterunFinishedCDEvent.class), /** * TestOutput published event. */ - TestOutputPublishedEvent("dev.cdevents.testoutput.published."), + TestOutputPublishedEvent("dev.cdevents.testoutput.published.", TestoutputPublishedCDEvent.class), /* Artifact Events */ /** * Artifact packaged event. */ - ArtifactPackagedEvent("dev.cdevents.artifact.packaged."), + ArtifactPackagedEvent("dev.cdevents.artifact.packaged.", ArtifactPackagedCDEvent.class), /** * Artifact published event. */ - ArtifactPublishedEvent("dev.cdevents.artifact.published."), + ArtifactPublishedEvent("dev.cdevents.artifact.published.", ArtifactPublishedCDEvent.class), /** * Artifact signed event. */ - ArtifactSignedEvent("dev.cdevents.artifact.signed."), + ArtifactSignedEvent("dev.cdevents.artifact.signed.", ArtifactSignedCDEvent.class), /* Environment Events */ /** * Environment created event. */ - EnvironmentCreatedEvent("dev.cdevents.environment.created."), + EnvironmentCreatedEvent("dev.cdevents.environment.created.", EnvironmentCreatedCDEvent.class), /** * Environment modified event. */ - EnvironmentModifiedEvent("dev.cdevents.environment.modified."), + EnvironmentModifiedEvent("dev.cdevents.environment.modified.", EnvironmentModifiedCDEvent.class), /** * Environment deleted event. */ - EnvironmentDeletedEvent("dev.cdevents.environment.deleted."), + EnvironmentDeletedEvent("dev.cdevents.environment.deleted.", EnvironmentDeletedCDEvent.class), /* Incident Events */ /** * Incident detected event. */ - IncidentDetectedEvent("dev.cdevents.incident.detected."), + IncidentDetectedEvent("dev.cdevents.incident.detected.", IncidentDetectedCDEvent.class), /** * Incident reported event. */ - IncidentReportedEvent("dev.cdevents.incident.reported."), + IncidentReportedEvent("dev.cdevents.incident.reported.", IncidentReportedCDEvent.class), /** * Incident resolved event. */ - IncidentResolvedEvent("dev.cdevents.incident.resolved."), + IncidentResolvedEvent("dev.cdevents.incident.resolved.", IncidentResolvedCDEvent.class), /* Service Events */ /** * Service deployed event. */ - ServiceDeployedEvent("dev.cdevents.service.deployed."), + ServiceDeployedEvent("dev.cdevents.service.deployed.", ServiceDeployedCDEvent.class), /** * Service upgraded event. */ - ServiceUpgradedEvent("dev.cdevents.service.upgraded."), + ServiceUpgradedEvent("dev.cdevents.service.upgraded.", ServiceUpgradedCDEvent.class), /** * Service rolled back event. */ - ServiceRolledBackEvent("dev.cdevents.service.rolledback."), + ServiceRolledBackEvent("dev.cdevents.service.rolledback.", ServiceRolledbackCDEvent.class), /** * Service removed event. */ - ServiceRemovedEvent("dev.cdevents.service.removed."), + ServiceRemovedEvent("dev.cdevents.service.removed.", ServiceRemovedCDEvent.class), /** * Service published event. */ - ServicePublishedEvent("dev.cdevents.service.published."); + ServicePublishedEvent("dev.cdevents.service.published.", ServicePublishedCDEvent.class); /** @@ -243,8 +263,11 @@ public enum CDEventTypes { */ private String eventType; - CDEventTypes(final String event) { + private Class eventClass; + + CDEventTypes(final String event, final Class eventClass) { this.eventType = event; + this.eventClass = eventClass; } /** @@ -261,6 +284,18 @@ public void setEventType(final String event) { this.eventType = event; } + /** + * @return class name of the event type + */ + public Class getEventClass() { + return eventClass; + } + /** + * @param eventClass class name to set + */ + public void setEventClass(Class eventClass) { + this.eventClass = eventClass; + } } } diff --git a/sdk/src/main/java/dev/cdevents/models/artifact/packaged/Content.java b/sdk/src/main/java/dev/cdevents/models/artifact/packaged/Content.java index e5a1c70..0e12a5e 100644 --- a/sdk/src/main/java/dev/cdevents/models/artifact/packaged/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/artifact/packaged/Content.java @@ -41,4 +41,23 @@ public void setChange(Change change) { this.change = change; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.change == null)? 0 :this.change.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return ((this.change == rhs.change)||((this.change!= null)&&this.change.equals(rhs.change))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/artifact/packaged/Context.java b/sdk/src/main/java/dev/cdevents/models/artifact/packaged/Context.java index e4d29d2..6ca5c32 100644 --- a/sdk/src/main/java/dev/cdevents/models/artifact/packaged/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/artifact/packaged/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/artifact/packaged/Subject.java b/sdk/src/main/java/dev/cdevents/models/artifact/packaged/Subject.java index b0dfd49..932b937 100644 --- a/sdk/src/main/java/dev/cdevents/models/artifact/packaged/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/artifact/packaged/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/artifact/published/Context.java b/sdk/src/main/java/dev/cdevents/models/artifact/published/Context.java index b8dfd22..c054d64 100644 --- a/sdk/src/main/java/dev/cdevents/models/artifact/published/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/artifact/published/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/artifact/published/Subject.java b/sdk/src/main/java/dev/cdevents/models/artifact/published/Subject.java index 6e148a3..d0b8031 100644 --- a/sdk/src/main/java/dev/cdevents/models/artifact/published/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/artifact/published/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/artifact/signed/Artifactsigned.java b/sdk/src/main/java/dev/cdevents/models/artifact/signed/Artifactsigned.java index 95a860e..aac4d06 100644 --- a/sdk/src/main/java/dev/cdevents/models/artifact/signed/Artifactsigned.java +++ b/sdk/src/main/java/dev/cdevents/models/artifact/signed/Artifactsigned.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Artifactsigned) == false) { + return false; + } + Artifactsigned rhs = ((Artifactsigned) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/artifact/signed/Content.java b/sdk/src/main/java/dev/cdevents/models/artifact/signed/Content.java index eb4673f..4a923d9 100644 --- a/sdk/src/main/java/dev/cdevents/models/artifact/signed/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/artifact/signed/Content.java @@ -41,4 +41,23 @@ public void setSignature(String signature) { this.signature = signature; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.signature == null)? 0 :this.signature.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return ((this.signature == rhs.signature)||((this.signature!= null)&&this.signature.equals(rhs.signature))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/artifact/signed/Context.java b/sdk/src/main/java/dev/cdevents/models/artifact/signed/Context.java index 303df27..220b4f7 100644 --- a/sdk/src/main/java/dev/cdevents/models/artifact/signed/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/artifact/signed/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/artifact/signed/Subject.java b/sdk/src/main/java/dev/cdevents/models/artifact/signed/Subject.java index a5ab429..6c728cc 100644 --- a/sdk/src/main/java/dev/cdevents/models/artifact/signed/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/artifact/signed/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/branch/created/Content.java b/sdk/src/main/java/dev/cdevents/models/branch/created/Content.java index 65f0fb9..1e6d785 100644 --- a/sdk/src/main/java/dev/cdevents/models/branch/created/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/branch/created/Content.java @@ -26,4 +26,23 @@ public void setRepository(Repository repository) { this.repository = repository; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.repository == null)? 0 :this.repository.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return ((this.repository == rhs.repository)||((this.repository!= null)&&this.repository.equals(rhs.repository))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/branch/created/Context.java b/sdk/src/main/java/dev/cdevents/models/branch/created/Context.java index 5706a5c..f3ae9cc 100644 --- a/sdk/src/main/java/dev/cdevents/models/branch/created/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/branch/created/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/branch/created/Subject.java b/sdk/src/main/java/dev/cdevents/models/branch/created/Subject.java index e5c191f..8ec67e6 100644 --- a/sdk/src/main/java/dev/cdevents/models/branch/created/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/branch/created/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/branch/deleted/Content.java b/sdk/src/main/java/dev/cdevents/models/branch/deleted/Content.java index 267f187..1e3a05e 100644 --- a/sdk/src/main/java/dev/cdevents/models/branch/deleted/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/branch/deleted/Content.java @@ -26,4 +26,23 @@ public void setRepository(Repository repository) { this.repository = repository; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.repository == null)? 0 :this.repository.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return ((this.repository == rhs.repository)||((this.repository!= null)&&this.repository.equals(rhs.repository))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/branch/deleted/Context.java b/sdk/src/main/java/dev/cdevents/models/branch/deleted/Context.java index e5a66c9..046e914 100644 --- a/sdk/src/main/java/dev/cdevents/models/branch/deleted/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/branch/deleted/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/branch/deleted/Subject.java b/sdk/src/main/java/dev/cdevents/models/branch/deleted/Subject.java index 81fda93..79c3969 100644 --- a/sdk/src/main/java/dev/cdevents/models/branch/deleted/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/branch/deleted/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/build/finished/Buildfinished.java b/sdk/src/main/java/dev/cdevents/models/build/finished/Buildfinished.java index 42ab74b..d0574c6 100644 --- a/sdk/src/main/java/dev/cdevents/models/build/finished/Buildfinished.java +++ b/sdk/src/main/java/dev/cdevents/models/build/finished/Buildfinished.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Buildfinished) == false) { + return false; + } + Buildfinished rhs = ((Buildfinished) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/build/finished/Content.java b/sdk/src/main/java/dev/cdevents/models/build/finished/Content.java index 4367f33..9b993ba 100644 --- a/sdk/src/main/java/dev/cdevents/models/build/finished/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/build/finished/Content.java @@ -26,4 +26,23 @@ public void setArtifactId(String artifactId) { this.artifactId = artifactId; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.artifactId == null)? 0 :this.artifactId.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return ((this.artifactId == rhs.artifactId)||((this.artifactId!= null)&&this.artifactId.equals(rhs.artifactId))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/build/finished/Context.java b/sdk/src/main/java/dev/cdevents/models/build/finished/Context.java index b082e98..93b6cc1 100644 --- a/sdk/src/main/java/dev/cdevents/models/build/finished/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/build/finished/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/build/finished/Subject.java b/sdk/src/main/java/dev/cdevents/models/build/finished/Subject.java index 8f4a44e..81bf619 100644 --- a/sdk/src/main/java/dev/cdevents/models/build/finished/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/build/finished/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/build/queued/Buildqueued.java b/sdk/src/main/java/dev/cdevents/models/build/queued/Buildqueued.java index ca0c6c3..d0e449b 100644 --- a/sdk/src/main/java/dev/cdevents/models/build/queued/Buildqueued.java +++ b/sdk/src/main/java/dev/cdevents/models/build/queued/Buildqueued.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Buildqueued) == false) { + return false; + } + Buildqueued rhs = ((Buildqueued) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/build/queued/Context.java b/sdk/src/main/java/dev/cdevents/models/build/queued/Context.java index 9a2a553..9101159 100644 --- a/sdk/src/main/java/dev/cdevents/models/build/queued/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/build/queued/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/build/queued/Subject.java b/sdk/src/main/java/dev/cdevents/models/build/queued/Subject.java index 3239810..215d299 100644 --- a/sdk/src/main/java/dev/cdevents/models/build/queued/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/build/queued/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/build/started/Buildstarted.java b/sdk/src/main/java/dev/cdevents/models/build/started/Buildstarted.java index d8939ea..7a393e0 100644 --- a/sdk/src/main/java/dev/cdevents/models/build/started/Buildstarted.java +++ b/sdk/src/main/java/dev/cdevents/models/build/started/Buildstarted.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Buildstarted) == false) { + return false; + } + Buildstarted rhs = ((Buildstarted) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/build/started/Context.java b/sdk/src/main/java/dev/cdevents/models/build/started/Context.java index df45e24..3ebd263 100644 --- a/sdk/src/main/java/dev/cdevents/models/build/started/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/build/started/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/build/started/Subject.java b/sdk/src/main/java/dev/cdevents/models/build/started/Subject.java index ae31c43..38cba77 100644 --- a/sdk/src/main/java/dev/cdevents/models/build/started/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/build/started/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/change/abandoned/Changeabandoned.java b/sdk/src/main/java/dev/cdevents/models/change/abandoned/Changeabandoned.java index ba3b9b6..56b5229 100644 --- a/sdk/src/main/java/dev/cdevents/models/change/abandoned/Changeabandoned.java +++ b/sdk/src/main/java/dev/cdevents/models/change/abandoned/Changeabandoned.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Changeabandoned) == false) { + return false; + } + Changeabandoned rhs = ((Changeabandoned) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/change/abandoned/Content.java b/sdk/src/main/java/dev/cdevents/models/change/abandoned/Content.java index eddb630..a6ad44b 100644 --- a/sdk/src/main/java/dev/cdevents/models/change/abandoned/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/change/abandoned/Content.java @@ -26,4 +26,23 @@ public void setRepository(Repository repository) { this.repository = repository; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.repository == null)? 0 :this.repository.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return ((this.repository == rhs.repository)||((this.repository!= null)&&this.repository.equals(rhs.repository))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/change/abandoned/Context.java b/sdk/src/main/java/dev/cdevents/models/change/abandoned/Context.java index ff20ab7..799d245 100644 --- a/sdk/src/main/java/dev/cdevents/models/change/abandoned/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/change/abandoned/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/change/abandoned/Subject.java b/sdk/src/main/java/dev/cdevents/models/change/abandoned/Subject.java index 1cc2cd1..c15ed4e 100644 --- a/sdk/src/main/java/dev/cdevents/models/change/abandoned/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/change/abandoned/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/change/created/Changecreated.java b/sdk/src/main/java/dev/cdevents/models/change/created/Changecreated.java index 79d6117..d1a9d02 100644 --- a/sdk/src/main/java/dev/cdevents/models/change/created/Changecreated.java +++ b/sdk/src/main/java/dev/cdevents/models/change/created/Changecreated.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Changecreated) == false) { + return false; + } + Changecreated rhs = ((Changecreated) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/change/created/Content.java b/sdk/src/main/java/dev/cdevents/models/change/created/Content.java index c61510c..087d9e8 100644 --- a/sdk/src/main/java/dev/cdevents/models/change/created/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/change/created/Content.java @@ -26,4 +26,23 @@ public void setRepository(Repository repository) { this.repository = repository; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.repository == null)? 0 :this.repository.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return ((this.repository == rhs.repository)||((this.repository!= null)&&this.repository.equals(rhs.repository))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/change/created/Context.java b/sdk/src/main/java/dev/cdevents/models/change/created/Context.java index e1b6dbc..2ab20a0 100644 --- a/sdk/src/main/java/dev/cdevents/models/change/created/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/change/created/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/change/created/Repository.java b/sdk/src/main/java/dev/cdevents/models/change/created/Repository.java index 0f72602..fa49e90 100644 --- a/sdk/src/main/java/dev/cdevents/models/change/created/Repository.java +++ b/sdk/src/main/java/dev/cdevents/models/change/created/Repository.java @@ -54,4 +54,24 @@ public void setSource(String source) { this.source = source; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Repository) == false) { + return false; + } + Repository rhs = ((Repository) other); + return (((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/change/created/Subject.java b/sdk/src/main/java/dev/cdevents/models/change/created/Subject.java index f3c481d..e7dbd3b 100644 --- a/sdk/src/main/java/dev/cdevents/models/change/created/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/change/created/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/change/merged/Changemerged.java b/sdk/src/main/java/dev/cdevents/models/change/merged/Changemerged.java index b66be57..a7ed4bb 100644 --- a/sdk/src/main/java/dev/cdevents/models/change/merged/Changemerged.java +++ b/sdk/src/main/java/dev/cdevents/models/change/merged/Changemerged.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Changemerged) == false) { + return false; + } + Changemerged rhs = ((Changemerged) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/change/merged/Content.java b/sdk/src/main/java/dev/cdevents/models/change/merged/Content.java index 879a4a2..0755539 100644 --- a/sdk/src/main/java/dev/cdevents/models/change/merged/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/change/merged/Content.java @@ -26,4 +26,23 @@ public void setRepository(Repository repository) { this.repository = repository; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.repository == null)? 0 :this.repository.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return ((this.repository == rhs.repository)||((this.repository!= null)&&this.repository.equals(rhs.repository))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/change/merged/Context.java b/sdk/src/main/java/dev/cdevents/models/change/merged/Context.java index ef6247c..56891f2 100644 --- a/sdk/src/main/java/dev/cdevents/models/change/merged/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/change/merged/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/change/merged/Repository.java b/sdk/src/main/java/dev/cdevents/models/change/merged/Repository.java index 8ab3a93..be8cdef 100644 --- a/sdk/src/main/java/dev/cdevents/models/change/merged/Repository.java +++ b/sdk/src/main/java/dev/cdevents/models/change/merged/Repository.java @@ -54,4 +54,24 @@ public void setSource(String source) { this.source = source; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Repository) == false) { + return false; + } + Repository rhs = ((Repository) other); + return (((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/change/merged/Subject.java b/sdk/src/main/java/dev/cdevents/models/change/merged/Subject.java index de513b6..c51a3af 100644 --- a/sdk/src/main/java/dev/cdevents/models/change/merged/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/change/merged/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/change/reviewed/Changereviewed.java b/sdk/src/main/java/dev/cdevents/models/change/reviewed/Changereviewed.java index 3cb2f73..65138af 100644 --- a/sdk/src/main/java/dev/cdevents/models/change/reviewed/Changereviewed.java +++ b/sdk/src/main/java/dev/cdevents/models/change/reviewed/Changereviewed.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Changereviewed) == false) { + return false; + } + Changereviewed rhs = ((Changereviewed) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/change/reviewed/Content.java b/sdk/src/main/java/dev/cdevents/models/change/reviewed/Content.java index a1f01e3..a77ef53 100644 --- a/sdk/src/main/java/dev/cdevents/models/change/reviewed/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/change/reviewed/Content.java @@ -26,4 +26,23 @@ public void setRepository(Repository repository) { this.repository = repository; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.repository == null)? 0 :this.repository.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return ((this.repository == rhs.repository)||((this.repository!= null)&&this.repository.equals(rhs.repository))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/change/reviewed/Context.java b/sdk/src/main/java/dev/cdevents/models/change/reviewed/Context.java index a32ad13..260a8e9 100644 --- a/sdk/src/main/java/dev/cdevents/models/change/reviewed/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/change/reviewed/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/change/reviewed/Repository.java b/sdk/src/main/java/dev/cdevents/models/change/reviewed/Repository.java index 4f508bc..bcef371 100644 --- a/sdk/src/main/java/dev/cdevents/models/change/reviewed/Repository.java +++ b/sdk/src/main/java/dev/cdevents/models/change/reviewed/Repository.java @@ -54,4 +54,24 @@ public void setSource(String source) { this.source = source; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Repository) == false) { + return false; + } + Repository rhs = ((Repository) other); + return (((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/change/reviewed/Subject.java b/sdk/src/main/java/dev/cdevents/models/change/reviewed/Subject.java index 2c11f99..035637a 100644 --- a/sdk/src/main/java/dev/cdevents/models/change/reviewed/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/change/reviewed/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/change/updated/Changeupdated.java b/sdk/src/main/java/dev/cdevents/models/change/updated/Changeupdated.java index 4b7fbf4..e2f0a51 100644 --- a/sdk/src/main/java/dev/cdevents/models/change/updated/Changeupdated.java +++ b/sdk/src/main/java/dev/cdevents/models/change/updated/Changeupdated.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Changeupdated) == false) { + return false; + } + Changeupdated rhs = ((Changeupdated) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/change/updated/Content.java b/sdk/src/main/java/dev/cdevents/models/change/updated/Content.java index b7e194e..3f2406d 100644 --- a/sdk/src/main/java/dev/cdevents/models/change/updated/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/change/updated/Content.java @@ -26,4 +26,23 @@ public void setRepository(Repository repository) { this.repository = repository; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.repository == null)? 0 :this.repository.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return ((this.repository == rhs.repository)||((this.repository!= null)&&this.repository.equals(rhs.repository))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/change/updated/Context.java b/sdk/src/main/java/dev/cdevents/models/change/updated/Context.java index ed925e6..e3de75a 100644 --- a/sdk/src/main/java/dev/cdevents/models/change/updated/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/change/updated/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/change/updated/Repository.java b/sdk/src/main/java/dev/cdevents/models/change/updated/Repository.java index ee6f371..fa7faf5 100644 --- a/sdk/src/main/java/dev/cdevents/models/change/updated/Repository.java +++ b/sdk/src/main/java/dev/cdevents/models/change/updated/Repository.java @@ -54,4 +54,24 @@ public void setSource(String source) { this.source = source; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Repository) == false) { + return false; + } + Repository rhs = ((Repository) other); + return (((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/change/updated/Subject.java b/sdk/src/main/java/dev/cdevents/models/change/updated/Subject.java index 9b94476..66e47d1 100644 --- a/sdk/src/main/java/dev/cdevents/models/change/updated/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/change/updated/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/environment/created/Content.java b/sdk/src/main/java/dev/cdevents/models/environment/created/Content.java index d4e5089..2309ebd 100644 --- a/sdk/src/main/java/dev/cdevents/models/environment/created/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/environment/created/Content.java @@ -39,4 +39,24 @@ public void setUrl(String url) { this.url = url; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode())); + result = ((result* 31)+((this.url == null)? 0 :this.url.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return (((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name)))&&((this.url == rhs.url)||((this.url!= null)&&this.url.equals(rhs.url)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/environment/created/Context.java b/sdk/src/main/java/dev/cdevents/models/environment/created/Context.java index 4892f8c..2954e88 100644 --- a/sdk/src/main/java/dev/cdevents/models/environment/created/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/environment/created/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/environment/created/Environmentcreated.java b/sdk/src/main/java/dev/cdevents/models/environment/created/Environmentcreated.java index 641adb2..5f29678 100644 --- a/sdk/src/main/java/dev/cdevents/models/environment/created/Environmentcreated.java +++ b/sdk/src/main/java/dev/cdevents/models/environment/created/Environmentcreated.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Environmentcreated) == false) { + return false; + } + Environmentcreated rhs = ((Environmentcreated) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/environment/created/Subject.java b/sdk/src/main/java/dev/cdevents/models/environment/created/Subject.java index 1e54097..f1dc171 100644 --- a/sdk/src/main/java/dev/cdevents/models/environment/created/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/environment/created/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/environment/deleted/Content.java b/sdk/src/main/java/dev/cdevents/models/environment/deleted/Content.java index 57d94dc..f916069 100644 --- a/sdk/src/main/java/dev/cdevents/models/environment/deleted/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/environment/deleted/Content.java @@ -26,4 +26,23 @@ public void setName(String name) { this.name = name; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return ((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/environment/deleted/Context.java b/sdk/src/main/java/dev/cdevents/models/environment/deleted/Context.java index 61df68e..e779a38 100644 --- a/sdk/src/main/java/dev/cdevents/models/environment/deleted/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/environment/deleted/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/environment/deleted/Environmentdeleted.java b/sdk/src/main/java/dev/cdevents/models/environment/deleted/Environmentdeleted.java index 8fd1e3f..87ab0af 100644 --- a/sdk/src/main/java/dev/cdevents/models/environment/deleted/Environmentdeleted.java +++ b/sdk/src/main/java/dev/cdevents/models/environment/deleted/Environmentdeleted.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Environmentdeleted) == false) { + return false; + } + Environmentdeleted rhs = ((Environmentdeleted) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/environment/deleted/Subject.java b/sdk/src/main/java/dev/cdevents/models/environment/deleted/Subject.java index 05ceee9..2bc992c 100644 --- a/sdk/src/main/java/dev/cdevents/models/environment/deleted/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/environment/deleted/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/environment/modified/Content.java b/sdk/src/main/java/dev/cdevents/models/environment/modified/Content.java index 40df7da..91e4b40 100644 --- a/sdk/src/main/java/dev/cdevents/models/environment/modified/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/environment/modified/Content.java @@ -39,4 +39,24 @@ public void setUrl(String url) { this.url = url; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode())); + result = ((result* 31)+((this.url == null)? 0 :this.url.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return (((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name)))&&((this.url == rhs.url)||((this.url!= null)&&this.url.equals(rhs.url)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/environment/modified/Context.java b/sdk/src/main/java/dev/cdevents/models/environment/modified/Context.java index 8f1bcb3..629049e 100644 --- a/sdk/src/main/java/dev/cdevents/models/environment/modified/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/environment/modified/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/environment/modified/Environmentmodified.java b/sdk/src/main/java/dev/cdevents/models/environment/modified/Environmentmodified.java index 365dc65..62d646f 100644 --- a/sdk/src/main/java/dev/cdevents/models/environment/modified/Environmentmodified.java +++ b/sdk/src/main/java/dev/cdevents/models/environment/modified/Environmentmodified.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Environmentmodified) == false) { + return false; + } + Environmentmodified rhs = ((Environmentmodified) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/environment/modified/Subject.java b/sdk/src/main/java/dev/cdevents/models/environment/modified/Subject.java index 5634078..a64c62d 100644 --- a/sdk/src/main/java/dev/cdevents/models/environment/modified/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/environment/modified/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/incident/detected/Content.java b/sdk/src/main/java/dev/cdevents/models/incident/detected/Content.java index fc1b87a..b7dbfec 100644 --- a/sdk/src/main/java/dev/cdevents/models/incident/detected/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/incident/detected/Content.java @@ -80,4 +80,26 @@ public void setArtifactId(String artifactId) { this.artifactId = artifactId; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.description == null)? 0 :this.description.hashCode())); + result = ((result* 31)+((this.environment == null)? 0 :this.environment.hashCode())); + result = ((result* 31)+((this.artifactId == null)? 0 :this.artifactId.hashCode())); + result = ((result* 31)+((this.service == null)? 0 :this.service.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return (((((this.description == rhs.description)||((this.description!= null)&&this.description.equals(rhs.description)))&&((this.environment == rhs.environment)||((this.environment!= null)&&this.environment.equals(rhs.environment))))&&((this.artifactId == rhs.artifactId)||((this.artifactId!= null)&&this.artifactId.equals(rhs.artifactId))))&&((this.service == rhs.service)||((this.service!= null)&&this.service.equals(rhs.service)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/incident/detected/Context.java b/sdk/src/main/java/dev/cdevents/models/incident/detected/Context.java index 08586f7..2ca2f0c 100644 --- a/sdk/src/main/java/dev/cdevents/models/incident/detected/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/incident/detected/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/incident/detected/Subject.java b/sdk/src/main/java/dev/cdevents/models/incident/detected/Subject.java index ffc5332..c44eab3 100644 --- a/sdk/src/main/java/dev/cdevents/models/incident/detected/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/incident/detected/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/incident/reported/Content.java b/sdk/src/main/java/dev/cdevents/models/incident/reported/Content.java index 5078801..5b77841 100644 --- a/sdk/src/main/java/dev/cdevents/models/incident/reported/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/incident/reported/Content.java @@ -109,4 +109,27 @@ public void setArtifactId(String artifactId) { this.artifactId = artifactId; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.description == null)? 0 :this.description.hashCode())); + result = ((result* 31)+((this.environment == null)? 0 :this.environment.hashCode())); + result = ((result* 31)+((this.ticketURI == null)? 0 :this.ticketURI.hashCode())); + result = ((result* 31)+((this.artifactId == null)? 0 :this.artifactId.hashCode())); + result = ((result* 31)+((this.service == null)? 0 :this.service.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return ((((((this.description == rhs.description)||((this.description!= null)&&this.description.equals(rhs.description)))&&((this.environment == rhs.environment)||((this.environment!= null)&&this.environment.equals(rhs.environment))))&&((this.ticketURI == rhs.ticketURI)||((this.ticketURI!= null)&&this.ticketURI.equals(rhs.ticketURI))))&&((this.artifactId == rhs.artifactId)||((this.artifactId!= null)&&this.artifactId.equals(rhs.artifactId))))&&((this.service == rhs.service)||((this.service!= null)&&this.service.equals(rhs.service)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/incident/reported/Context.java b/sdk/src/main/java/dev/cdevents/models/incident/reported/Context.java index ad5f3c3..f6c3a3c 100644 --- a/sdk/src/main/java/dev/cdevents/models/incident/reported/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/incident/reported/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/incident/reported/Subject.java b/sdk/src/main/java/dev/cdevents/models/incident/reported/Subject.java index 358416a..7551696 100644 --- a/sdk/src/main/java/dev/cdevents/models/incident/reported/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/incident/reported/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/incident/resolved/Content.java b/sdk/src/main/java/dev/cdevents/models/incident/resolved/Content.java index 8b378bb..de67899 100644 --- a/sdk/src/main/java/dev/cdevents/models/incident/resolved/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/incident/resolved/Content.java @@ -80,4 +80,26 @@ public void setArtifactId(String artifactId) { this.artifactId = artifactId; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.description == null)? 0 :this.description.hashCode())); + result = ((result* 31)+((this.environment == null)? 0 :this.environment.hashCode())); + result = ((result* 31)+((this.artifactId == null)? 0 :this.artifactId.hashCode())); + result = ((result* 31)+((this.service == null)? 0 :this.service.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return (((((this.description == rhs.description)||((this.description!= null)&&this.description.equals(rhs.description)))&&((this.environment == rhs.environment)||((this.environment!= null)&&this.environment.equals(rhs.environment))))&&((this.artifactId == rhs.artifactId)||((this.artifactId!= null)&&this.artifactId.equals(rhs.artifactId))))&&((this.service == rhs.service)||((this.service!= null)&&this.service.equals(rhs.service)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/incident/resolved/Context.java b/sdk/src/main/java/dev/cdevents/models/incident/resolved/Context.java index 4aa1f90..cf21f9e 100644 --- a/sdk/src/main/java/dev/cdevents/models/incident/resolved/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/incident/resolved/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/incident/resolved/Environment.java b/sdk/src/main/java/dev/cdevents/models/incident/resolved/Environment.java index 12e7f5c..1dead40 100644 --- a/sdk/src/main/java/dev/cdevents/models/incident/resolved/Environment.java +++ b/sdk/src/main/java/dev/cdevents/models/incident/resolved/Environment.java @@ -54,4 +54,24 @@ public void setSource(String source) { this.source = source; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Environment) == false) { + return false; + } + Environment rhs = ((Environment) other); + return (((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/incident/resolved/Service.java b/sdk/src/main/java/dev/cdevents/models/incident/resolved/Service.java index 85370d8..20f822c 100644 --- a/sdk/src/main/java/dev/cdevents/models/incident/resolved/Service.java +++ b/sdk/src/main/java/dev/cdevents/models/incident/resolved/Service.java @@ -54,4 +54,24 @@ public void setSource(String source) { this.source = source; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Service) == false) { + return false; + } + Service rhs = ((Service) other); + return (((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/incident/resolved/Subject.java b/sdk/src/main/java/dev/cdevents/models/incident/resolved/Subject.java index 0cf08e4..5a5c0e3 100644 --- a/sdk/src/main/java/dev/cdevents/models/incident/resolved/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/incident/resolved/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/pipelinerun/finished/Content.java b/sdk/src/main/java/dev/cdevents/models/pipelinerun/finished/Content.java index 35026c2..1f1003b 100644 --- a/sdk/src/main/java/dev/cdevents/models/pipelinerun/finished/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/pipelinerun/finished/Content.java @@ -65,4 +65,26 @@ public void setErrors(String errors) { this.errors = errors; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.pipelineName == null)? 0 :this.pipelineName.hashCode())); + result = ((result* 31)+((this.url == null)? 0 :this.url.hashCode())); + result = ((result* 31)+((this.outcome == null)? 0 :this.outcome.hashCode())); + result = ((result* 31)+((this.errors == null)? 0 :this.errors.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return (((((this.pipelineName == rhs.pipelineName)||((this.pipelineName!= null)&&this.pipelineName.equals(rhs.pipelineName)))&&((this.url == rhs.url)||((this.url!= null)&&this.url.equals(rhs.url))))&&((this.outcome == rhs.outcome)||((this.outcome!= null)&&this.outcome.equals(rhs.outcome))))&&((this.errors == rhs.errors)||((this.errors!= null)&&this.errors.equals(rhs.errors)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/pipelinerun/finished/Context.java b/sdk/src/main/java/dev/cdevents/models/pipelinerun/finished/Context.java index 1c92375..3749cf9 100644 --- a/sdk/src/main/java/dev/cdevents/models/pipelinerun/finished/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/pipelinerun/finished/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/pipelinerun/finished/Pipelinerunfinished.java b/sdk/src/main/java/dev/cdevents/models/pipelinerun/finished/Pipelinerunfinished.java index f0e41fa..ec0a2b8 100644 --- a/sdk/src/main/java/dev/cdevents/models/pipelinerun/finished/Pipelinerunfinished.java +++ b/sdk/src/main/java/dev/cdevents/models/pipelinerun/finished/Pipelinerunfinished.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Pipelinerunfinished) == false) { + return false; + } + Pipelinerunfinished rhs = ((Pipelinerunfinished) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/pipelinerun/finished/Subject.java b/sdk/src/main/java/dev/cdevents/models/pipelinerun/finished/Subject.java index 7fa28f1..ac16186 100644 --- a/sdk/src/main/java/dev/cdevents/models/pipelinerun/finished/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/pipelinerun/finished/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/pipelinerun/queued/Content.java b/sdk/src/main/java/dev/cdevents/models/pipelinerun/queued/Content.java index 00a8def..c6e3749 100644 --- a/sdk/src/main/java/dev/cdevents/models/pipelinerun/queued/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/pipelinerun/queued/Content.java @@ -39,4 +39,24 @@ public void setUrl(String url) { this.url = url; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.pipelineName == null)? 0 :this.pipelineName.hashCode())); + result = ((result* 31)+((this.url == null)? 0 :this.url.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return (((this.pipelineName == rhs.pipelineName)||((this.pipelineName!= null)&&this.pipelineName.equals(rhs.pipelineName)))&&((this.url == rhs.url)||((this.url!= null)&&this.url.equals(rhs.url)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/pipelinerun/queued/Context.java b/sdk/src/main/java/dev/cdevents/models/pipelinerun/queued/Context.java index 32d3441..dc699d4 100644 --- a/sdk/src/main/java/dev/cdevents/models/pipelinerun/queued/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/pipelinerun/queued/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/pipelinerun/queued/Pipelinerunqueued.java b/sdk/src/main/java/dev/cdevents/models/pipelinerun/queued/Pipelinerunqueued.java index eef35d9..d3b104f 100644 --- a/sdk/src/main/java/dev/cdevents/models/pipelinerun/queued/Pipelinerunqueued.java +++ b/sdk/src/main/java/dev/cdevents/models/pipelinerun/queued/Pipelinerunqueued.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Pipelinerunqueued) == false) { + return false; + } + Pipelinerunqueued rhs = ((Pipelinerunqueued) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/pipelinerun/queued/Subject.java b/sdk/src/main/java/dev/cdevents/models/pipelinerun/queued/Subject.java index 12b2df2..dc7507d 100644 --- a/sdk/src/main/java/dev/cdevents/models/pipelinerun/queued/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/pipelinerun/queued/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/pipelinerun/started/Content.java b/sdk/src/main/java/dev/cdevents/models/pipelinerun/started/Content.java index eadf21a..c28367c 100644 --- a/sdk/src/main/java/dev/cdevents/models/pipelinerun/started/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/pipelinerun/started/Content.java @@ -69,4 +69,24 @@ public void setUrl(String url) { this.url = url; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.pipelineName == null)? 0 :this.pipelineName.hashCode())); + result = ((result* 31)+((this.url == null)? 0 :this.url.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return (((this.pipelineName == rhs.pipelineName)||((this.pipelineName!= null)&&this.pipelineName.equals(rhs.pipelineName)))&&((this.url == rhs.url)||((this.url!= null)&&this.url.equals(rhs.url)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/pipelinerun/started/Context.java b/sdk/src/main/java/dev/cdevents/models/pipelinerun/started/Context.java index 8e1e6bb..d65fcf9 100644 --- a/sdk/src/main/java/dev/cdevents/models/pipelinerun/started/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/pipelinerun/started/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/pipelinerun/started/Pipelinerunstarted.java b/sdk/src/main/java/dev/cdevents/models/pipelinerun/started/Pipelinerunstarted.java index b2098e8..62de8e6 100644 --- a/sdk/src/main/java/dev/cdevents/models/pipelinerun/started/Pipelinerunstarted.java +++ b/sdk/src/main/java/dev/cdevents/models/pipelinerun/started/Pipelinerunstarted.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Pipelinerunstarted) == false) { + return false; + } + Pipelinerunstarted rhs = ((Pipelinerunstarted) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/pipelinerun/started/Subject.java b/sdk/src/main/java/dev/cdevents/models/pipelinerun/started/Subject.java index 6e893a7..42ba363 100644 --- a/sdk/src/main/java/dev/cdevents/models/pipelinerun/started/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/pipelinerun/started/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/repository/created/Content.java b/sdk/src/main/java/dev/cdevents/models/repository/created/Content.java index 90e39a4..4132efc 100644 --- a/sdk/src/main/java/dev/cdevents/models/repository/created/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/repository/created/Content.java @@ -95,4 +95,26 @@ public void setViewUrl(String viewUrl) { this.viewUrl = viewUrl; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode())); + result = ((result* 31)+((this.owner == null)? 0 :this.owner.hashCode())); + result = ((result* 31)+((this.viewUrl == null)? 0 :this.viewUrl.hashCode())); + result = ((result* 31)+((this.url == null)? 0 :this.url.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return (((((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name)))&&((this.owner == rhs.owner)||((this.owner!= null)&&this.owner.equals(rhs.owner))))&&((this.viewUrl == rhs.viewUrl)||((this.viewUrl!= null)&&this.viewUrl.equals(rhs.viewUrl))))&&((this.url == rhs.url)||((this.url!= null)&&this.url.equals(rhs.url)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/repository/created/Context.java b/sdk/src/main/java/dev/cdevents/models/repository/created/Context.java index 3d49312..187fef5 100644 --- a/sdk/src/main/java/dev/cdevents/models/repository/created/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/repository/created/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/repository/created/Repositorycreated.java b/sdk/src/main/java/dev/cdevents/models/repository/created/Repositorycreated.java index 53756fa..f125a6b 100644 --- a/sdk/src/main/java/dev/cdevents/models/repository/created/Repositorycreated.java +++ b/sdk/src/main/java/dev/cdevents/models/repository/created/Repositorycreated.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Repositorycreated) == false) { + return false; + } + Repositorycreated rhs = ((Repositorycreated) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/repository/created/Subject.java b/sdk/src/main/java/dev/cdevents/models/repository/created/Subject.java index e3b22a7..e95a2d0 100644 --- a/sdk/src/main/java/dev/cdevents/models/repository/created/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/repository/created/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/repository/deleted/Content.java b/sdk/src/main/java/dev/cdevents/models/repository/deleted/Content.java index 36f88ab..0ada567 100644 --- a/sdk/src/main/java/dev/cdevents/models/repository/deleted/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/repository/deleted/Content.java @@ -65,4 +65,26 @@ public void setViewUrl(String viewUrl) { this.viewUrl = viewUrl; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode())); + result = ((result* 31)+((this.owner == null)? 0 :this.owner.hashCode())); + result = ((result* 31)+((this.viewUrl == null)? 0 :this.viewUrl.hashCode())); + result = ((result* 31)+((this.url == null)? 0 :this.url.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return (((((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name)))&&((this.owner == rhs.owner)||((this.owner!= null)&&this.owner.equals(rhs.owner))))&&((this.viewUrl == rhs.viewUrl)||((this.viewUrl!= null)&&this.viewUrl.equals(rhs.viewUrl))))&&((this.url == rhs.url)||((this.url!= null)&&this.url.equals(rhs.url)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/repository/deleted/Context.java b/sdk/src/main/java/dev/cdevents/models/repository/deleted/Context.java index 43c6608..be5b3b3 100644 --- a/sdk/src/main/java/dev/cdevents/models/repository/deleted/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/repository/deleted/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/repository/deleted/Repositorydeleted.java b/sdk/src/main/java/dev/cdevents/models/repository/deleted/Repositorydeleted.java index 39c2959..81b17c7 100644 --- a/sdk/src/main/java/dev/cdevents/models/repository/deleted/Repositorydeleted.java +++ b/sdk/src/main/java/dev/cdevents/models/repository/deleted/Repositorydeleted.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Repositorydeleted) == false) { + return false; + } + Repositorydeleted rhs = ((Repositorydeleted) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/repository/deleted/Subject.java b/sdk/src/main/java/dev/cdevents/models/repository/deleted/Subject.java index 608484e..d4cd263 100644 --- a/sdk/src/main/java/dev/cdevents/models/repository/deleted/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/repository/deleted/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/repository/modified/Content.java b/sdk/src/main/java/dev/cdevents/models/repository/modified/Content.java index e7eefee..bcccdcc 100644 --- a/sdk/src/main/java/dev/cdevents/models/repository/modified/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/repository/modified/Content.java @@ -65,4 +65,26 @@ public void setViewUrl(String viewUrl) { this.viewUrl = viewUrl; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode())); + result = ((result* 31)+((this.owner == null)? 0 :this.owner.hashCode())); + result = ((result* 31)+((this.viewUrl == null)? 0 :this.viewUrl.hashCode())); + result = ((result* 31)+((this.url == null)? 0 :this.url.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return (((((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name)))&&((this.owner == rhs.owner)||((this.owner!= null)&&this.owner.equals(rhs.owner))))&&((this.viewUrl == rhs.viewUrl)||((this.viewUrl!= null)&&this.viewUrl.equals(rhs.viewUrl))))&&((this.url == rhs.url)||((this.url!= null)&&this.url.equals(rhs.url)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/repository/modified/Context.java b/sdk/src/main/java/dev/cdevents/models/repository/modified/Context.java index 767e5a9..1cde722 100644 --- a/sdk/src/main/java/dev/cdevents/models/repository/modified/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/repository/modified/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/repository/modified/Repositorymodified.java b/sdk/src/main/java/dev/cdevents/models/repository/modified/Repositorymodified.java index b4512ae..00fb91e 100644 --- a/sdk/src/main/java/dev/cdevents/models/repository/modified/Repositorymodified.java +++ b/sdk/src/main/java/dev/cdevents/models/repository/modified/Repositorymodified.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Repositorymodified) == false) { + return false; + } + Repositorymodified rhs = ((Repositorymodified) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/repository/modified/Subject.java b/sdk/src/main/java/dev/cdevents/models/repository/modified/Subject.java index 20b7608..f981b04 100644 --- a/sdk/src/main/java/dev/cdevents/models/repository/modified/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/repository/modified/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/service/deployed/Content.java b/sdk/src/main/java/dev/cdevents/models/service/deployed/Content.java index 6bc1c6f..e7e1858 100644 --- a/sdk/src/main/java/dev/cdevents/models/service/deployed/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/service/deployed/Content.java @@ -69,4 +69,24 @@ public void setArtifactId(String artifactId) { this.artifactId = artifactId; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.environment == null)? 0 :this.environment.hashCode())); + result = ((result* 31)+((this.artifactId == null)? 0 :this.artifactId.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return (((this.environment == rhs.environment)||((this.environment!= null)&&this.environment.equals(rhs.environment)))&&((this.artifactId == rhs.artifactId)||((this.artifactId!= null)&&this.artifactId.equals(rhs.artifactId)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/service/deployed/Context.java b/sdk/src/main/java/dev/cdevents/models/service/deployed/Context.java index 047fd77..352a10e 100644 --- a/sdk/src/main/java/dev/cdevents/models/service/deployed/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/service/deployed/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/service/deployed/Environment.java b/sdk/src/main/java/dev/cdevents/models/service/deployed/Environment.java index 4345601..2d673b6 100644 --- a/sdk/src/main/java/dev/cdevents/models/service/deployed/Environment.java +++ b/sdk/src/main/java/dev/cdevents/models/service/deployed/Environment.java @@ -54,4 +54,24 @@ public void setSource(String source) { this.source = source; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Environment) == false) { + return false; + } + Environment rhs = ((Environment) other); + return (((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/service/deployed/Servicedeployed.java b/sdk/src/main/java/dev/cdevents/models/service/deployed/Servicedeployed.java index ef5b7f6..9a0f8d0 100644 --- a/sdk/src/main/java/dev/cdevents/models/service/deployed/Servicedeployed.java +++ b/sdk/src/main/java/dev/cdevents/models/service/deployed/Servicedeployed.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Servicedeployed) == false) { + return false; + } + Servicedeployed rhs = ((Servicedeployed) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/service/deployed/Subject.java b/sdk/src/main/java/dev/cdevents/models/service/deployed/Subject.java index ebfaf80..63e2b27 100644 --- a/sdk/src/main/java/dev/cdevents/models/service/deployed/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/service/deployed/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/service/published/Content.java b/sdk/src/main/java/dev/cdevents/models/service/published/Content.java index 787aa31..76d9d98 100644 --- a/sdk/src/main/java/dev/cdevents/models/service/published/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/service/published/Content.java @@ -26,4 +26,23 @@ public void setEnvironment(Environment environment) { this.environment = environment; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.environment == null)? 0 :this.environment.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return ((this.environment == rhs.environment)||((this.environment!= null)&&this.environment.equals(rhs.environment))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/service/published/Context.java b/sdk/src/main/java/dev/cdevents/models/service/published/Context.java index 2e03593..962d7d6 100644 --- a/sdk/src/main/java/dev/cdevents/models/service/published/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/service/published/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/service/published/Environment.java b/sdk/src/main/java/dev/cdevents/models/service/published/Environment.java index fbbff59..c5497fb 100644 --- a/sdk/src/main/java/dev/cdevents/models/service/published/Environment.java +++ b/sdk/src/main/java/dev/cdevents/models/service/published/Environment.java @@ -54,4 +54,24 @@ public void setSource(String source) { this.source = source; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Environment) == false) { + return false; + } + Environment rhs = ((Environment) other); + return (((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/service/published/Servicepublished.java b/sdk/src/main/java/dev/cdevents/models/service/published/Servicepublished.java index 345455d..858d386 100644 --- a/sdk/src/main/java/dev/cdevents/models/service/published/Servicepublished.java +++ b/sdk/src/main/java/dev/cdevents/models/service/published/Servicepublished.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Servicepublished) == false) { + return false; + } + Servicepublished rhs = ((Servicepublished) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/service/published/Subject.java b/sdk/src/main/java/dev/cdevents/models/service/published/Subject.java index 4979539..8ea8a22 100644 --- a/sdk/src/main/java/dev/cdevents/models/service/published/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/service/published/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/service/removed/Content.java b/sdk/src/main/java/dev/cdevents/models/service/removed/Content.java index 87aafdc..b1f7230 100644 --- a/sdk/src/main/java/dev/cdevents/models/service/removed/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/service/removed/Content.java @@ -26,4 +26,23 @@ public void setEnvironment(Environment environment) { this.environment = environment; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.environment == null)? 0 :this.environment.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return ((this.environment == rhs.environment)||((this.environment!= null)&&this.environment.equals(rhs.environment))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/service/removed/Context.java b/sdk/src/main/java/dev/cdevents/models/service/removed/Context.java index c6800d2..7dd4ee6 100644 --- a/sdk/src/main/java/dev/cdevents/models/service/removed/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/service/removed/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/service/removed/Environment.java b/sdk/src/main/java/dev/cdevents/models/service/removed/Environment.java index ceb878c..8be3cdd 100644 --- a/sdk/src/main/java/dev/cdevents/models/service/removed/Environment.java +++ b/sdk/src/main/java/dev/cdevents/models/service/removed/Environment.java @@ -54,4 +54,24 @@ public void setSource(String source) { this.source = source; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Environment) == false) { + return false; + } + Environment rhs = ((Environment) other); + return (((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/service/removed/Serviceremoved.java b/sdk/src/main/java/dev/cdevents/models/service/removed/Serviceremoved.java index f6af8b6..6dab5a2 100644 --- a/sdk/src/main/java/dev/cdevents/models/service/removed/Serviceremoved.java +++ b/sdk/src/main/java/dev/cdevents/models/service/removed/Serviceremoved.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Serviceremoved) == false) { + return false; + } + Serviceremoved rhs = ((Serviceremoved) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/service/removed/Subject.java b/sdk/src/main/java/dev/cdevents/models/service/removed/Subject.java index 891473f..1c0f867 100644 --- a/sdk/src/main/java/dev/cdevents/models/service/removed/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/service/removed/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/service/rolledback/Content.java b/sdk/src/main/java/dev/cdevents/models/service/rolledback/Content.java index dee2cc5..0ab1512 100644 --- a/sdk/src/main/java/dev/cdevents/models/service/rolledback/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/service/rolledback/Content.java @@ -69,4 +69,24 @@ public void setArtifactId(String artifactId) { this.artifactId = artifactId; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.environment == null)? 0 :this.environment.hashCode())); + result = ((result* 31)+((this.artifactId == null)? 0 :this.artifactId.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return (((this.environment == rhs.environment)||((this.environment!= null)&&this.environment.equals(rhs.environment)))&&((this.artifactId == rhs.artifactId)||((this.artifactId!= null)&&this.artifactId.equals(rhs.artifactId)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/service/rolledback/Context.java b/sdk/src/main/java/dev/cdevents/models/service/rolledback/Context.java index fb5f6f7..b5bf311 100644 --- a/sdk/src/main/java/dev/cdevents/models/service/rolledback/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/service/rolledback/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/service/rolledback/Environment.java b/sdk/src/main/java/dev/cdevents/models/service/rolledback/Environment.java index 78c5c10..3d0e079 100644 --- a/sdk/src/main/java/dev/cdevents/models/service/rolledback/Environment.java +++ b/sdk/src/main/java/dev/cdevents/models/service/rolledback/Environment.java @@ -54,4 +54,24 @@ public void setSource(String source) { this.source = source; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Environment) == false) { + return false; + } + Environment rhs = ((Environment) other); + return (((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/service/rolledback/Servicerolledback.java b/sdk/src/main/java/dev/cdevents/models/service/rolledback/Servicerolledback.java index da79bf1..b12df04 100644 --- a/sdk/src/main/java/dev/cdevents/models/service/rolledback/Servicerolledback.java +++ b/sdk/src/main/java/dev/cdevents/models/service/rolledback/Servicerolledback.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Servicerolledback) == false) { + return false; + } + Servicerolledback rhs = ((Servicerolledback) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/service/rolledback/Subject.java b/sdk/src/main/java/dev/cdevents/models/service/rolledback/Subject.java index 3a82d6e..5d07cd2 100644 --- a/sdk/src/main/java/dev/cdevents/models/service/rolledback/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/service/rolledback/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/service/upgraded/Content.java b/sdk/src/main/java/dev/cdevents/models/service/upgraded/Content.java index 19b546d..1a031fd 100644 --- a/sdk/src/main/java/dev/cdevents/models/service/upgraded/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/service/upgraded/Content.java @@ -69,4 +69,24 @@ public void setArtifactId(String artifactId) { this.artifactId = artifactId; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.environment == null)? 0 :this.environment.hashCode())); + result = ((result* 31)+((this.artifactId == null)? 0 :this.artifactId.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return (((this.environment == rhs.environment)||((this.environment!= null)&&this.environment.equals(rhs.environment)))&&((this.artifactId == rhs.artifactId)||((this.artifactId!= null)&&this.artifactId.equals(rhs.artifactId)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/service/upgraded/Context.java b/sdk/src/main/java/dev/cdevents/models/service/upgraded/Context.java index 3cac87d..7b404fd 100644 --- a/sdk/src/main/java/dev/cdevents/models/service/upgraded/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/service/upgraded/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/service/upgraded/Environment.java b/sdk/src/main/java/dev/cdevents/models/service/upgraded/Environment.java index c3aed02..9e3e9ae 100644 --- a/sdk/src/main/java/dev/cdevents/models/service/upgraded/Environment.java +++ b/sdk/src/main/java/dev/cdevents/models/service/upgraded/Environment.java @@ -54,4 +54,24 @@ public void setSource(String source) { this.source = source; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Environment) == false) { + return false; + } + Environment rhs = ((Environment) other); + return (((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/service/upgraded/Serviceupgraded.java b/sdk/src/main/java/dev/cdevents/models/service/upgraded/Serviceupgraded.java index ed9d7e2..4139c89 100644 --- a/sdk/src/main/java/dev/cdevents/models/service/upgraded/Serviceupgraded.java +++ b/sdk/src/main/java/dev/cdevents/models/service/upgraded/Serviceupgraded.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Serviceupgraded) == false) { + return false; + } + Serviceupgraded rhs = ((Serviceupgraded) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/service/upgraded/Subject.java b/sdk/src/main/java/dev/cdevents/models/service/upgraded/Subject.java index 5c5dc24..24f75e9 100644 --- a/sdk/src/main/java/dev/cdevents/models/service/upgraded/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/service/upgraded/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/taskrun/finished/Content.java b/sdk/src/main/java/dev/cdevents/models/taskrun/finished/Content.java index a317206..98977c3 100644 --- a/sdk/src/main/java/dev/cdevents/models/taskrun/finished/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/taskrun/finished/Content.java @@ -78,4 +78,27 @@ public void setErrors(String errors) { this.errors = errors; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.taskName == null)? 0 :this.taskName.hashCode())); + result = ((result* 31)+((this.url == null)? 0 :this.url.hashCode())); + result = ((result* 31)+((this.pipelineRun == null)? 0 :this.pipelineRun.hashCode())); + result = ((result* 31)+((this.outcome == null)? 0 :this.outcome.hashCode())); + result = ((result* 31)+((this.errors == null)? 0 :this.errors.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return ((((((this.taskName == rhs.taskName)||((this.taskName!= null)&&this.taskName.equals(rhs.taskName)))&&((this.url == rhs.url)||((this.url!= null)&&this.url.equals(rhs.url))))&&((this.pipelineRun == rhs.pipelineRun)||((this.pipelineRun!= null)&&this.pipelineRun.equals(rhs.pipelineRun))))&&((this.outcome == rhs.outcome)||((this.outcome!= null)&&this.outcome.equals(rhs.outcome))))&&((this.errors == rhs.errors)||((this.errors!= null)&&this.errors.equals(rhs.errors)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/taskrun/finished/Context.java b/sdk/src/main/java/dev/cdevents/models/taskrun/finished/Context.java index 6bb56b6..fdd606c 100644 --- a/sdk/src/main/java/dev/cdevents/models/taskrun/finished/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/taskrun/finished/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/taskrun/finished/PipelineRun.java b/sdk/src/main/java/dev/cdevents/models/taskrun/finished/PipelineRun.java index e9da7b4..5e7771c 100644 --- a/sdk/src/main/java/dev/cdevents/models/taskrun/finished/PipelineRun.java +++ b/sdk/src/main/java/dev/cdevents/models/taskrun/finished/PipelineRun.java @@ -54,4 +54,24 @@ public void setSource(String source) { this.source = source; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof PipelineRun) == false) { + return false; + } + PipelineRun rhs = ((PipelineRun) other); + return (((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/taskrun/finished/Subject.java b/sdk/src/main/java/dev/cdevents/models/taskrun/finished/Subject.java index 8857ce7..02da8f9 100644 --- a/sdk/src/main/java/dev/cdevents/models/taskrun/finished/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/taskrun/finished/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/taskrun/finished/Taskrunfinished.java b/sdk/src/main/java/dev/cdevents/models/taskrun/finished/Taskrunfinished.java index 6293729..e1ab6bb 100644 --- a/sdk/src/main/java/dev/cdevents/models/taskrun/finished/Taskrunfinished.java +++ b/sdk/src/main/java/dev/cdevents/models/taskrun/finished/Taskrunfinished.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Taskrunfinished) == false) { + return false; + } + Taskrunfinished rhs = ((Taskrunfinished) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/taskrun/started/Content.java b/sdk/src/main/java/dev/cdevents/models/taskrun/started/Content.java index 0961328..b71e901 100644 --- a/sdk/src/main/java/dev/cdevents/models/taskrun/started/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/taskrun/started/Content.java @@ -52,4 +52,25 @@ public void setPipelineRun(PipelineRun pipelineRun) { this.pipelineRun = pipelineRun; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.taskName == null)? 0 :this.taskName.hashCode())); + result = ((result* 31)+((this.url == null)? 0 :this.url.hashCode())); + result = ((result* 31)+((this.pipelineRun == null)? 0 :this.pipelineRun.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return ((((this.taskName == rhs.taskName)||((this.taskName!= null)&&this.taskName.equals(rhs.taskName)))&&((this.url == rhs.url)||((this.url!= null)&&this.url.equals(rhs.url))))&&((this.pipelineRun == rhs.pipelineRun)||((this.pipelineRun!= null)&&this.pipelineRun.equals(rhs.pipelineRun)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/taskrun/started/Context.java b/sdk/src/main/java/dev/cdevents/models/taskrun/started/Context.java index bcf2c9e..cde8977 100644 --- a/sdk/src/main/java/dev/cdevents/models/taskrun/started/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/taskrun/started/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/taskrun/started/PipelineRun.java b/sdk/src/main/java/dev/cdevents/models/taskrun/started/PipelineRun.java index 4cc0dfe..0e4debe 100644 --- a/sdk/src/main/java/dev/cdevents/models/taskrun/started/PipelineRun.java +++ b/sdk/src/main/java/dev/cdevents/models/taskrun/started/PipelineRun.java @@ -54,4 +54,24 @@ public void setSource(String source) { this.source = source; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof PipelineRun) == false) { + return false; + } + PipelineRun rhs = ((PipelineRun) other); + return (((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/taskrun/started/Subject.java b/sdk/src/main/java/dev/cdevents/models/taskrun/started/Subject.java index 5024c28..2b68754 100644 --- a/sdk/src/main/java/dev/cdevents/models/taskrun/started/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/taskrun/started/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/taskrun/started/Taskrunstarted.java b/sdk/src/main/java/dev/cdevents/models/taskrun/started/Taskrunstarted.java index 781d39d..4409ab5 100644 --- a/sdk/src/main/java/dev/cdevents/models/taskrun/started/Taskrunstarted.java +++ b/sdk/src/main/java/dev/cdevents/models/taskrun/started/Taskrunstarted.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Taskrunstarted) == false) { + return false; + } + Taskrunstarted rhs = ((Taskrunstarted) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/testcaserun/finished/Content.java b/sdk/src/main/java/dev/cdevents/models/testcaserun/finished/Content.java index 52ecc95..7380b23 100644 --- a/sdk/src/main/java/dev/cdevents/models/testcaserun/finished/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/testcaserun/finished/Content.java @@ -125,6 +125,30 @@ public void setTestCase(TestCase testCase) { this.testCase = testCase; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.severity == null)? 0 :this.severity.hashCode())); + result = ((result* 31)+((this.reason == null)? 0 :this.reason.hashCode())); + result = ((result* 31)+((this.environment == null)? 0 :this.environment.hashCode())); + result = ((result* 31)+((this.testSuiteRun == null)? 0 :this.testSuiteRun.hashCode())); + result = ((result* 31)+((this.outcome == null)? 0 :this.outcome.hashCode())); + result = ((result* 31)+((this.testCase == null)? 0 :this.testCase.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return (((((((this.severity == rhs.severity)||((this.severity!= null)&&this.severity.equals(rhs.severity)))&&((this.reason == rhs.reason)||((this.reason!= null)&&this.reason.equals(rhs.reason))))&&((this.environment == rhs.environment)||((this.environment!= null)&&this.environment.equals(rhs.environment))))&&((this.testSuiteRun == rhs.testSuiteRun)||((this.testSuiteRun!= null)&&this.testSuiteRun.equals(rhs.testSuiteRun))))&&((this.outcome == rhs.outcome)||((this.outcome!= null)&&this.outcome.equals(rhs.outcome))))&&((this.testCase == rhs.testCase)||((this.testCase!= null)&&this.testCase.equals(rhs.testCase)))); + } + @Generated("jsonschema2pojo") public enum Outcome { diff --git a/sdk/src/main/java/dev/cdevents/models/testcaserun/finished/Context.java b/sdk/src/main/java/dev/cdevents/models/testcaserun/finished/Context.java index dad4e31..110b0d0 100644 --- a/sdk/src/main/java/dev/cdevents/models/testcaserun/finished/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/testcaserun/finished/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/testcaserun/finished/Environment.java b/sdk/src/main/java/dev/cdevents/models/testcaserun/finished/Environment.java index f789cf5..b82548c 100644 --- a/sdk/src/main/java/dev/cdevents/models/testcaserun/finished/Environment.java +++ b/sdk/src/main/java/dev/cdevents/models/testcaserun/finished/Environment.java @@ -54,4 +54,24 @@ public void setSource(String source) { this.source = source; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Environment) == false) { + return false; + } + Environment rhs = ((Environment) other); + return (((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/testcaserun/finished/Subject.java b/sdk/src/main/java/dev/cdevents/models/testcaserun/finished/Subject.java index 368d716..8243efd 100644 --- a/sdk/src/main/java/dev/cdevents/models/testcaserun/finished/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/testcaserun/finished/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/testcaserun/finished/TestCase.java b/sdk/src/main/java/dev/cdevents/models/testcaserun/finished/TestCase.java index 3b2f65b..c92b86f 100644 --- a/sdk/src/main/java/dev/cdevents/models/testcaserun/finished/TestCase.java +++ b/sdk/src/main/java/dev/cdevents/models/testcaserun/finished/TestCase.java @@ -98,6 +98,29 @@ public void setUri(URI uri) { this.uri = uri; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode())); + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.uri == null)? 0 :this.uri.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof TestCase) == false) { + return false; + } + TestCase rhs = ((TestCase) other); + return ((((((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name)))&&((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.uri == rhs.uri)||((this.uri!= null)&&this.uri.equals(rhs.uri)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/testcaserun/finished/TestSuiteRun.java b/sdk/src/main/java/dev/cdevents/models/testcaserun/finished/TestSuiteRun.java index ac5a27d..dc916d5 100644 --- a/sdk/src/main/java/dev/cdevents/models/testcaserun/finished/TestSuiteRun.java +++ b/sdk/src/main/java/dev/cdevents/models/testcaserun/finished/TestSuiteRun.java @@ -54,4 +54,24 @@ public void setSource(String source) { this.source = source; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof TestSuiteRun) == false) { + return false; + } + TestSuiteRun rhs = ((TestSuiteRun) other); + return (((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/testcaserun/finished/Testcaserunfinished.java b/sdk/src/main/java/dev/cdevents/models/testcaserun/finished/Testcaserunfinished.java index d855763..9a22656 100644 --- a/sdk/src/main/java/dev/cdevents/models/testcaserun/finished/Testcaserunfinished.java +++ b/sdk/src/main/java/dev/cdevents/models/testcaserun/finished/Testcaserunfinished.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Testcaserunfinished) == false) { + return false; + } + Testcaserunfinished rhs = ((Testcaserunfinished) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/testcaserun/queued/Content.java b/sdk/src/main/java/dev/cdevents/models/testcaserun/queued/Content.java index 97a9bcf..7d2824f 100644 --- a/sdk/src/main/java/dev/cdevents/models/testcaserun/queued/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/testcaserun/queued/Content.java @@ -80,4 +80,26 @@ public void setTestCase(TestCase testCase) { this.testCase = testCase; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.environment == null)? 0 :this.environment.hashCode())); + result = ((result* 31)+((this.trigger == null)? 0 :this.trigger.hashCode())); + result = ((result* 31)+((this.testSuiteRun == null)? 0 :this.testSuiteRun.hashCode())); + result = ((result* 31)+((this.testCase == null)? 0 :this.testCase.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return (((((this.environment == rhs.environment)||((this.environment!= null)&&this.environment.equals(rhs.environment)))&&((this.trigger == rhs.trigger)||((this.trigger!= null)&&this.trigger.equals(rhs.trigger))))&&((this.testSuiteRun == rhs.testSuiteRun)||((this.testSuiteRun!= null)&&this.testSuiteRun.equals(rhs.testSuiteRun))))&&((this.testCase == rhs.testCase)||((this.testCase!= null)&&this.testCase.equals(rhs.testCase)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/testcaserun/queued/Context.java b/sdk/src/main/java/dev/cdevents/models/testcaserun/queued/Context.java index eda4765..7b61c3a 100644 --- a/sdk/src/main/java/dev/cdevents/models/testcaserun/queued/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/testcaserun/queued/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/testcaserun/queued/Environment.java b/sdk/src/main/java/dev/cdevents/models/testcaserun/queued/Environment.java index 1924e58..6de1542 100644 --- a/sdk/src/main/java/dev/cdevents/models/testcaserun/queued/Environment.java +++ b/sdk/src/main/java/dev/cdevents/models/testcaserun/queued/Environment.java @@ -54,4 +54,24 @@ public void setSource(String source) { this.source = source; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Environment) == false) { + return false; + } + Environment rhs = ((Environment) other); + return (((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/testcaserun/queued/Subject.java b/sdk/src/main/java/dev/cdevents/models/testcaserun/queued/Subject.java index c127669..aed310a 100644 --- a/sdk/src/main/java/dev/cdevents/models/testcaserun/queued/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/testcaserun/queued/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/testcaserun/queued/TestCase.java b/sdk/src/main/java/dev/cdevents/models/testcaserun/queued/TestCase.java index 2c3003e..689c2c9 100644 --- a/sdk/src/main/java/dev/cdevents/models/testcaserun/queued/TestCase.java +++ b/sdk/src/main/java/dev/cdevents/models/testcaserun/queued/TestCase.java @@ -98,6 +98,29 @@ public void setUri(URI uri) { this.uri = uri; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode())); + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.uri == null)? 0 :this.uri.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof TestCase) == false) { + return false; + } + TestCase rhs = ((TestCase) other); + return ((((((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name)))&&((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.uri == rhs.uri)||((this.uri!= null)&&this.uri.equals(rhs.uri)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/testcaserun/queued/TestSuiteRun.java b/sdk/src/main/java/dev/cdevents/models/testcaserun/queued/TestSuiteRun.java index 1b57470..d499cde 100644 --- a/sdk/src/main/java/dev/cdevents/models/testcaserun/queued/TestSuiteRun.java +++ b/sdk/src/main/java/dev/cdevents/models/testcaserun/queued/TestSuiteRun.java @@ -54,4 +54,24 @@ public void setSource(String source) { this.source = source; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof TestSuiteRun) == false) { + return false; + } + TestSuiteRun rhs = ((TestSuiteRun) other); + return (((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/testcaserun/queued/Trigger.java b/sdk/src/main/java/dev/cdevents/models/testcaserun/queued/Trigger.java index 22c1080..7c548e6 100644 --- a/sdk/src/main/java/dev/cdevents/models/testcaserun/queued/Trigger.java +++ b/sdk/src/main/java/dev/cdevents/models/testcaserun/queued/Trigger.java @@ -60,6 +60,27 @@ public void setAdditionalProperty(String name, Object value) { this.additionalProperties.put(name, value); } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.uri == null)? 0 :this.uri.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Trigger) == false) { + return false; + } + Trigger rhs = ((Trigger) other); + return ((((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties)))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.uri == rhs.uri)||((this.uri!= null)&&this.uri.equals(rhs.uri)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/testcaserun/started/Content.java b/sdk/src/main/java/dev/cdevents/models/testcaserun/started/Content.java index ff41542..4b614c7 100644 --- a/sdk/src/main/java/dev/cdevents/models/testcaserun/started/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/testcaserun/started/Content.java @@ -80,4 +80,26 @@ public void setTestCase(TestCase testCase) { this.testCase = testCase; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.environment == null)? 0 :this.environment.hashCode())); + result = ((result* 31)+((this.trigger == null)? 0 :this.trigger.hashCode())); + result = ((result* 31)+((this.testSuiteRun == null)? 0 :this.testSuiteRun.hashCode())); + result = ((result* 31)+((this.testCase == null)? 0 :this.testCase.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return (((((this.environment == rhs.environment)||((this.environment!= null)&&this.environment.equals(rhs.environment)))&&((this.trigger == rhs.trigger)||((this.trigger!= null)&&this.trigger.equals(rhs.trigger))))&&((this.testSuiteRun == rhs.testSuiteRun)||((this.testSuiteRun!= null)&&this.testSuiteRun.equals(rhs.testSuiteRun))))&&((this.testCase == rhs.testCase)||((this.testCase!= null)&&this.testCase.equals(rhs.testCase)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/testcaserun/started/Context.java b/sdk/src/main/java/dev/cdevents/models/testcaserun/started/Context.java index 1276c1f..872b0f4 100644 --- a/sdk/src/main/java/dev/cdevents/models/testcaserun/started/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/testcaserun/started/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/testcaserun/started/Environment.java b/sdk/src/main/java/dev/cdevents/models/testcaserun/started/Environment.java index 2591fd7..a48d91a 100644 --- a/sdk/src/main/java/dev/cdevents/models/testcaserun/started/Environment.java +++ b/sdk/src/main/java/dev/cdevents/models/testcaserun/started/Environment.java @@ -54,4 +54,24 @@ public void setSource(String source) { this.source = source; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Environment) == false) { + return false; + } + Environment rhs = ((Environment) other); + return (((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/testcaserun/started/Subject.java b/sdk/src/main/java/dev/cdevents/models/testcaserun/started/Subject.java index a519349..acf661a 100644 --- a/sdk/src/main/java/dev/cdevents/models/testcaserun/started/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/testcaserun/started/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/testcaserun/started/TestCase.java b/sdk/src/main/java/dev/cdevents/models/testcaserun/started/TestCase.java index df0178c..4db4e1c 100644 --- a/sdk/src/main/java/dev/cdevents/models/testcaserun/started/TestCase.java +++ b/sdk/src/main/java/dev/cdevents/models/testcaserun/started/TestCase.java @@ -98,6 +98,29 @@ public void setUri(URI uri) { this.uri = uri; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode())); + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.uri == null)? 0 :this.uri.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof TestCase) == false) { + return false; + } + TestCase rhs = ((TestCase) other); + return ((((((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name)))&&((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.uri == rhs.uri)||((this.uri!= null)&&this.uri.equals(rhs.uri)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/testcaserun/started/TestSuiteRun.java b/sdk/src/main/java/dev/cdevents/models/testcaserun/started/TestSuiteRun.java index 5d92b57..28f3466 100644 --- a/sdk/src/main/java/dev/cdevents/models/testcaserun/started/TestSuiteRun.java +++ b/sdk/src/main/java/dev/cdevents/models/testcaserun/started/TestSuiteRun.java @@ -54,4 +54,24 @@ public void setSource(String source) { this.source = source; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof TestSuiteRun) == false) { + return false; + } + TestSuiteRun rhs = ((TestSuiteRun) other); + return (((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/testcaserun/started/Testcaserunstarted.java b/sdk/src/main/java/dev/cdevents/models/testcaserun/started/Testcaserunstarted.java index 4d1dcf0..31d16ba 100644 --- a/sdk/src/main/java/dev/cdevents/models/testcaserun/started/Testcaserunstarted.java +++ b/sdk/src/main/java/dev/cdevents/models/testcaserun/started/Testcaserunstarted.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Testcaserunstarted) == false) { + return false; + } + Testcaserunstarted rhs = ((Testcaserunstarted) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/testcaserun/started/Trigger.java b/sdk/src/main/java/dev/cdevents/models/testcaserun/started/Trigger.java index d4a6f03..87e24d0 100644 --- a/sdk/src/main/java/dev/cdevents/models/testcaserun/started/Trigger.java +++ b/sdk/src/main/java/dev/cdevents/models/testcaserun/started/Trigger.java @@ -60,6 +60,27 @@ public void setAdditionalProperty(String name, Object value) { this.additionalProperties.put(name, value); } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.uri == null)? 0 :this.uri.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Trigger) == false) { + return false; + } + Trigger rhs = ((Trigger) other); + return ((((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties)))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.uri == rhs.uri)||((this.uri!= null)&&this.uri.equals(rhs.uri)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/testoutput/published/Content.java b/sdk/src/main/java/dev/cdevents/models/testoutput/published/Content.java index 6af0bd0..68f117b 100644 --- a/sdk/src/main/java/dev/cdevents/models/testoutput/published/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/testoutput/published/Content.java @@ -100,6 +100,28 @@ public void setTestCaseRun(TestCaseRun testCaseRun) { this.testCaseRun = testCaseRun; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.format == null)? 0 :this.format.hashCode())); + result = ((result* 31)+((this.outputType == null)? 0 :this.outputType.hashCode())); + result = ((result* 31)+((this.uri == null)? 0 :this.uri.hashCode())); + result = ((result* 31)+((this.testCaseRun == null)? 0 :this.testCaseRun.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return (((((this.format == rhs.format)||((this.format!= null)&&this.format.equals(rhs.format)))&&((this.outputType == rhs.outputType)||((this.outputType!= null)&&this.outputType.equals(rhs.outputType))))&&((this.uri == rhs.uri)||((this.uri!= null)&&this.uri.equals(rhs.uri))))&&((this.testCaseRun == rhs.testCaseRun)||((this.testCaseRun!= null)&&this.testCaseRun.equals(rhs.testCaseRun)))); + } + @Generated("jsonschema2pojo") public enum OutputType { diff --git a/sdk/src/main/java/dev/cdevents/models/testoutput/published/Context.java b/sdk/src/main/java/dev/cdevents/models/testoutput/published/Context.java index d1beff6..ca3163c 100644 --- a/sdk/src/main/java/dev/cdevents/models/testoutput/published/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/testoutput/published/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/testoutput/published/Subject.java b/sdk/src/main/java/dev/cdevents/models/testoutput/published/Subject.java index 830ebd6..46a953e 100644 --- a/sdk/src/main/java/dev/cdevents/models/testoutput/published/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/testoutput/published/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/testoutput/published/TestCaseRun.java b/sdk/src/main/java/dev/cdevents/models/testoutput/published/TestCaseRun.java index dd97b47..050e805 100644 --- a/sdk/src/main/java/dev/cdevents/models/testoutput/published/TestCaseRun.java +++ b/sdk/src/main/java/dev/cdevents/models/testoutput/published/TestCaseRun.java @@ -54,4 +54,24 @@ public void setSource(String source) { this.source = source; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof TestCaseRun) == false) { + return false; + } + TestCaseRun rhs = ((TestCaseRun) other); + return (((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/testoutput/published/Testoutputpublished.java b/sdk/src/main/java/dev/cdevents/models/testoutput/published/Testoutputpublished.java index d9bc911..127cdbb 100644 --- a/sdk/src/main/java/dev/cdevents/models/testoutput/published/Testoutputpublished.java +++ b/sdk/src/main/java/dev/cdevents/models/testoutput/published/Testoutputpublished.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Testoutputpublished) == false) { + return false; + } + Testoutputpublished rhs = ((Testoutputpublished) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/testsuiterun/finished/Content.java b/sdk/src/main/java/dev/cdevents/models/testsuiterun/finished/Content.java index 0576bde..e3550d0 100644 --- a/sdk/src/main/java/dev/cdevents/models/testsuiterun/finished/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/testsuiterun/finished/Content.java @@ -112,6 +112,29 @@ public void setReason(String reason) { this.reason = reason; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.severity == null)? 0 :this.severity.hashCode())); + result = ((result* 31)+((this.reason == null)? 0 :this.reason.hashCode())); + result = ((result* 31)+((this.environment == null)? 0 :this.environment.hashCode())); + result = ((result* 31)+((this.testSuite == null)? 0 :this.testSuite.hashCode())); + result = ((result* 31)+((this.outcome == null)? 0 :this.outcome.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return ((((((this.severity == rhs.severity)||((this.severity!= null)&&this.severity.equals(rhs.severity)))&&((this.reason == rhs.reason)||((this.reason!= null)&&this.reason.equals(rhs.reason))))&&((this.environment == rhs.environment)||((this.environment!= null)&&this.environment.equals(rhs.environment))))&&((this.testSuite == rhs.testSuite)||((this.testSuite!= null)&&this.testSuite.equals(rhs.testSuite))))&&((this.outcome == rhs.outcome)||((this.outcome!= null)&&this.outcome.equals(rhs.outcome)))); + } + @Generated("jsonschema2pojo") public enum Outcome { diff --git a/sdk/src/main/java/dev/cdevents/models/testsuiterun/finished/Context.java b/sdk/src/main/java/dev/cdevents/models/testsuiterun/finished/Context.java index 8cbb9f0..d0c627b 100644 --- a/sdk/src/main/java/dev/cdevents/models/testsuiterun/finished/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/testsuiterun/finished/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/testsuiterun/finished/Environment.java b/sdk/src/main/java/dev/cdevents/models/testsuiterun/finished/Environment.java index d62427c..931df07 100644 --- a/sdk/src/main/java/dev/cdevents/models/testsuiterun/finished/Environment.java +++ b/sdk/src/main/java/dev/cdevents/models/testsuiterun/finished/Environment.java @@ -54,4 +54,24 @@ public void setSource(String source) { this.source = source; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Environment) == false) { + return false; + } + Environment rhs = ((Environment) other); + return (((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/testsuiterun/finished/Subject.java b/sdk/src/main/java/dev/cdevents/models/testsuiterun/finished/Subject.java index 142da69..ef52653 100644 --- a/sdk/src/main/java/dev/cdevents/models/testsuiterun/finished/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/testsuiterun/finished/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/testsuiterun/finished/TestSuite.java b/sdk/src/main/java/dev/cdevents/models/testsuiterun/finished/TestSuite.java index cfc0262..f38e70a 100644 --- a/sdk/src/main/java/dev/cdevents/models/testsuiterun/finished/TestSuite.java +++ b/sdk/src/main/java/dev/cdevents/models/testsuiterun/finished/TestSuite.java @@ -81,4 +81,26 @@ public void setUri(URI uri) { this.uri = uri; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode())); + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.uri == null)? 0 :this.uri.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof TestSuite) == false) { + return false; + } + TestSuite rhs = ((TestSuite) other); + return (((((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name)))&&((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.uri == rhs.uri)||((this.uri!= null)&&this.uri.equals(rhs.uri)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/testsuiterun/finished/Testsuiterunfinished.java b/sdk/src/main/java/dev/cdevents/models/testsuiterun/finished/Testsuiterunfinished.java index 28c87b1..62842a4 100644 --- a/sdk/src/main/java/dev/cdevents/models/testsuiterun/finished/Testsuiterunfinished.java +++ b/sdk/src/main/java/dev/cdevents/models/testsuiterun/finished/Testsuiterunfinished.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Testsuiterunfinished) == false) { + return false; + } + Testsuiterunfinished rhs = ((Testsuiterunfinished) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/testsuiterun/queued/Content.java b/sdk/src/main/java/dev/cdevents/models/testsuiterun/queued/Content.java index 38a7bfe..44c56dc 100644 --- a/sdk/src/main/java/dev/cdevents/models/testsuiterun/queued/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/testsuiterun/queued/Content.java @@ -67,4 +67,25 @@ public void setTestSuite(TestSuite testSuite) { this.testSuite = testSuite; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.environment == null)? 0 :this.environment.hashCode())); + result = ((result* 31)+((this.trigger == null)? 0 :this.trigger.hashCode())); + result = ((result* 31)+((this.testSuite == null)? 0 :this.testSuite.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return ((((this.environment == rhs.environment)||((this.environment!= null)&&this.environment.equals(rhs.environment)))&&((this.trigger == rhs.trigger)||((this.trigger!= null)&&this.trigger.equals(rhs.trigger))))&&((this.testSuite == rhs.testSuite)||((this.testSuite!= null)&&this.testSuite.equals(rhs.testSuite)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/testsuiterun/queued/Context.java b/sdk/src/main/java/dev/cdevents/models/testsuiterun/queued/Context.java index 4e56d4d..a06bdc1 100644 --- a/sdk/src/main/java/dev/cdevents/models/testsuiterun/queued/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/testsuiterun/queued/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/testsuiterun/queued/Environment.java b/sdk/src/main/java/dev/cdevents/models/testsuiterun/queued/Environment.java index 40393c5..f04ebf3 100644 --- a/sdk/src/main/java/dev/cdevents/models/testsuiterun/queued/Environment.java +++ b/sdk/src/main/java/dev/cdevents/models/testsuiterun/queued/Environment.java @@ -54,4 +54,24 @@ public void setSource(String source) { this.source = source; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Environment) == false) { + return false; + } + Environment rhs = ((Environment) other); + return (((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/testsuiterun/queued/Subject.java b/sdk/src/main/java/dev/cdevents/models/testsuiterun/queued/Subject.java index 683179e..a54d891 100644 --- a/sdk/src/main/java/dev/cdevents/models/testsuiterun/queued/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/testsuiterun/queued/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/testsuiterun/queued/TestSuite.java b/sdk/src/main/java/dev/cdevents/models/testsuiterun/queued/TestSuite.java index 91f3f60..c2bfe25 100644 --- a/sdk/src/main/java/dev/cdevents/models/testsuiterun/queued/TestSuite.java +++ b/sdk/src/main/java/dev/cdevents/models/testsuiterun/queued/TestSuite.java @@ -81,4 +81,26 @@ public void setUrl(URI url) { this.url = url; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode())); + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.url == null)? 0 :this.url.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof TestSuite) == false) { + return false; + } + TestSuite rhs = ((TestSuite) other); + return (((((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name)))&&((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.url == rhs.url)||((this.url!= null)&&this.url.equals(rhs.url)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/testsuiterun/queued/Testsuiterunqueued.java b/sdk/src/main/java/dev/cdevents/models/testsuiterun/queued/Testsuiterunqueued.java index a9c8583..4a12ec8 100644 --- a/sdk/src/main/java/dev/cdevents/models/testsuiterun/queued/Testsuiterunqueued.java +++ b/sdk/src/main/java/dev/cdevents/models/testsuiterun/queued/Testsuiterunqueued.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Testsuiterunqueued) == false) { + return false; + } + Testsuiterunqueued rhs = ((Testsuiterunqueued) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/testsuiterun/queued/Trigger.java b/sdk/src/main/java/dev/cdevents/models/testsuiterun/queued/Trigger.java index fa53dce..dd011c8 100644 --- a/sdk/src/main/java/dev/cdevents/models/testsuiterun/queued/Trigger.java +++ b/sdk/src/main/java/dev/cdevents/models/testsuiterun/queued/Trigger.java @@ -60,6 +60,27 @@ public void setAdditionalProperty(String name, Object value) { this.additionalProperties.put(name, value); } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.uri == null)? 0 :this.uri.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Trigger) == false) { + return false; + } + Trigger rhs = ((Trigger) other); + return ((((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties)))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.uri == rhs.uri)||((this.uri!= null)&&this.uri.equals(rhs.uri)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/testsuiterun/started/Content.java b/sdk/src/main/java/dev/cdevents/models/testsuiterun/started/Content.java index 5df1396..d9678e6 100644 --- a/sdk/src/main/java/dev/cdevents/models/testsuiterun/started/Content.java +++ b/sdk/src/main/java/dev/cdevents/models/testsuiterun/started/Content.java @@ -67,4 +67,25 @@ public void setTestSuite(TestSuite testSuite) { this.testSuite = testSuite; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.environment == null)? 0 :this.environment.hashCode())); + result = ((result* 31)+((this.trigger == null)? 0 :this.trigger.hashCode())); + result = ((result* 31)+((this.testSuite == null)? 0 :this.testSuite.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Content) == false) { + return false; + } + Content rhs = ((Content) other); + return ((((this.environment == rhs.environment)||((this.environment!= null)&&this.environment.equals(rhs.environment)))&&((this.trigger == rhs.trigger)||((this.trigger!= null)&&this.trigger.equals(rhs.trigger))))&&((this.testSuite == rhs.testSuite)||((this.testSuite!= null)&&this.testSuite.equals(rhs.testSuite)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/testsuiterun/started/Context.java b/sdk/src/main/java/dev/cdevents/models/testsuiterun/started/Context.java index 50ecddd..2dc7823 100644 --- a/sdk/src/main/java/dev/cdevents/models/testsuiterun/started/Context.java +++ b/sdk/src/main/java/dev/cdevents/models/testsuiterun/started/Context.java @@ -158,6 +158,29 @@ public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Context) == false) { + return false; + } + Context rhs = ((Context) other); + return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/testsuiterun/started/Environment.java b/sdk/src/main/java/dev/cdevents/models/testsuiterun/started/Environment.java index 9afc0b9..b683e7e 100644 --- a/sdk/src/main/java/dev/cdevents/models/testsuiterun/started/Environment.java +++ b/sdk/src/main/java/dev/cdevents/models/testsuiterun/started/Environment.java @@ -54,4 +54,24 @@ public void setSource(String source) { this.source = source; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Environment) == false) { + return false; + } + Environment rhs = ((Environment) other); + return (((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/testsuiterun/started/Subject.java b/sdk/src/main/java/dev/cdevents/models/testsuiterun/started/Subject.java index e1bee67..50aa9aa 100644 --- a/sdk/src/main/java/dev/cdevents/models/testsuiterun/started/Subject.java +++ b/sdk/src/main/java/dev/cdevents/models/testsuiterun/started/Subject.java @@ -114,6 +114,28 @@ public void setContent(Content content) { this.content = content; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Subject) == false) { + return false; + } + Subject rhs = ((Subject) other); + return (((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/main/java/dev/cdevents/models/testsuiterun/started/TestSuite.java b/sdk/src/main/java/dev/cdevents/models/testsuiterun/started/TestSuite.java index 2a13254..eacd779 100644 --- a/sdk/src/main/java/dev/cdevents/models/testsuiterun/started/TestSuite.java +++ b/sdk/src/main/java/dev/cdevents/models/testsuiterun/started/TestSuite.java @@ -81,4 +81,26 @@ public void setUri(URI uri) { this.uri = uri; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode())); + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.uri == null)? 0 :this.uri.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof TestSuite) == false) { + return false; + } + TestSuite rhs = ((TestSuite) other); + return (((((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name)))&&((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.uri == rhs.uri)||((this.uri!= null)&&this.uri.equals(rhs.uri)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/testsuiterun/started/Testsuiterunstarted.java b/sdk/src/main/java/dev/cdevents/models/testsuiterun/started/Testsuiterunstarted.java index fac9369..0f074b0 100644 --- a/sdk/src/main/java/dev/cdevents/models/testsuiterun/started/Testsuiterunstarted.java +++ b/sdk/src/main/java/dev/cdevents/models/testsuiterun/started/Testsuiterunstarted.java @@ -95,4 +95,26 @@ public void setCustomDataContentType(String customDataContentType) { this.customDataContentType = customDataContentType; } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.context == null)? 0 :this.context.hashCode())); + result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode())); + result = ((result* 31)+((this.customDataContentType == null)? 0 :this.customDataContentType.hashCode())); + result = ((result* 31)+((this.subject == null)? 0 :this.subject.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Testsuiterunstarted) == false) { + return false; + } + Testsuiterunstarted rhs = ((Testsuiterunstarted) other); + return (((((this.context == rhs.context)||((this.context!= null)&&this.context.equals(rhs.context)))&&((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData))))&&((this.customDataContentType == rhs.customDataContentType)||((this.customDataContentType!= null)&&this.customDataContentType.equals(rhs.customDataContentType))))&&((this.subject == rhs.subject)||((this.subject!= null)&&this.subject.equals(rhs.subject)))); + } + } diff --git a/sdk/src/main/java/dev/cdevents/models/testsuiterun/started/Trigger.java b/sdk/src/main/java/dev/cdevents/models/testsuiterun/started/Trigger.java index 9c0c97c..18530c4 100644 --- a/sdk/src/main/java/dev/cdevents/models/testsuiterun/started/Trigger.java +++ b/sdk/src/main/java/dev/cdevents/models/testsuiterun/started/Trigger.java @@ -60,6 +60,27 @@ public void setAdditionalProperty(String name, Object value) { this.additionalProperties.put(name, value); } + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.uri == null)? 0 :this.uri.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Trigger) == false) { + return false; + } + Trigger rhs = ((Trigger) other); + return ((((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties)))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.uri == rhs.uri)||((this.uri!= null)&&this.uri.equals(rhs.uri)))); + } + @Generated("jsonschema2pojo") public enum Type { diff --git a/sdk/src/test/java/dev/cdevents/CDEventsSpecExamplesTest.java b/sdk/src/test/java/dev/cdevents/CDEventsSpecExamplesTest.java new file mode 100644 index 0000000..ae46321 --- /dev/null +++ b/sdk/src/test/java/dev/cdevents/CDEventsSpecExamplesTest.java @@ -0,0 +1,1026 @@ +package dev.cdevents; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import dev.cdevents.constants.CDEventConstants; +import dev.cdevents.events.*; +import dev.cdevents.models.CDEvent; +import dev.cdevents.models.testcaserun.finished.Content; +import dev.cdevents.models.testcaserun.finished.TestCase; +import dev.cdevents.models.testcaserun.queued.Trigger; +import org.junit.jupiter.api.Test; + +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.util.HashMap; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class CDEventsSpecExamplesTest { + + private static String EXAMPLES_FOLDER = CDEventConstants.SPEC_REPO + File.separator + "examples"; + private static ObjectMapper objectMapper = new ObjectMapper(); + + + @Test + void testArtifactPackagedCDEvent() throws IOException { + + File artifactPackagedExample = new File(EXAMPLES_FOLDER + File.separator + "artifact_packaged.json"); + JsonNode expectedNode = objectMapper.readTree(artifactPackagedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + ArtifactPackagedCDEvent expectedEvent = (ArtifactPackagedCDEvent) expectedCDEvent; + + ArtifactPackagedCDEvent createdEvent = new ArtifactPackagedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("pkg:golang/mygit.com/myorg/myapp@234fd47e07d1004f0aed9c"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectChangeId("myChange123"); + createdEvent.setSubjectChangeSource("my-git.example/an-org/a-repo"); + + //replace context id, timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + @Test + void testArtifactPublishedCDEvent() throws IOException { + + File artifactPublishedExample = new File(EXAMPLES_FOLDER + File.separator + "artifact_published.json"); + JsonNode expectedNode = objectMapper.readTree(artifactPublishedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + ArtifactPublishedCDEvent expectedEvent = (ArtifactPublishedCDEvent) expectedCDEvent; + + ArtifactPublishedCDEvent createdEvent = new ArtifactPublishedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("pkg:golang/mygit.com/myorg/myapp@234fd47e07d1004f0aed9c"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + + //replace context id, timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + + @Test + void testArtifactSignedCDEvent() throws IOException { + + File artifactSignedExample = new File(EXAMPLES_FOLDER + File.separator + "artifact_signed.json"); + JsonNode expectedNode = objectMapper.readTree(artifactSignedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + ArtifactSignedCDEvent expectedEvent = (ArtifactSignedCDEvent) expectedCDEvent; + + ArtifactSignedCDEvent createdEvent = new ArtifactSignedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("pkg:golang/mygit.com/myorg/myapp@234fd47e07d1004f0aed9c"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectSignature("MEYCIQCBT8U5ypDXWCjlNKfzTV4KH516/SK13NZSh8znnSMNkQIhAJ3XiQlc9PM1KyjITcZXHotdMB+J3NGua5T/yshmiPmp"); + + //replace context id, timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + + @Test + void testBranchCreatedCDEvent() throws IOException { + + File branchCreatedExample = new File(EXAMPLES_FOLDER + File.separator + "branch_created.json"); + JsonNode expectedNode = objectMapper.readTree(branchCreatedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + BranchCreatedCDEvent expectedEvent = (BranchCreatedCDEvent) expectedCDEvent; + + BranchCreatedCDEvent createdEvent = new BranchCreatedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("mySubject123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectRepositoryId("TestRepo/TestOrg"); + createdEvent.setSubjectRepositorySource("https://example.org"); + + //replace context id, timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + + @Test + void testBranchDeletedCDEvent() throws IOException { + + File branchDeletedExample = new File(EXAMPLES_FOLDER + File.separator + "branch_deleted.json"); + JsonNode expectedNode = objectMapper.readTree(branchDeletedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + BranchDeletedCDEvent expectedEvent = (BranchDeletedCDEvent) expectedCDEvent; + + BranchDeletedCDEvent createdEvent = new BranchDeletedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("mySubject123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectRepositoryId("TestRepo/TestOrg"); + createdEvent.setSubjectRepositorySource("https://example.org"); + + //replace context id, timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + @Test + void testBuildFinishedCDEvent() throws IOException { + + File buildFinishedExample = new File(EXAMPLES_FOLDER + File.separator + "build_finished.json"); + JsonNode expectedNode = objectMapper.readTree(buildFinishedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + BuildFinishedCDEvent expectedEvent = (BuildFinishedCDEvent) expectedCDEvent; + + BuildFinishedCDEvent createdEvent = new BuildFinishedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("mySubject123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectArtifactId("pkg:oci/myapp@sha256%3A0b31b1c02ff458ad9b7b81cbdf8f028bd54699fa151f221d1e8de6817db93427"); + + //replace context id, timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + + @Test + void testBuildQueuedCDEvent() throws IOException { + + File buildQueuedExample = new File(EXAMPLES_FOLDER + File.separator + "build_queued.json"); + JsonNode expectedNode = objectMapper.readTree(buildQueuedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + BuildQueuedCDEvent expectedEvent = (BuildQueuedCDEvent) expectedCDEvent; + + BuildQueuedCDEvent createdEvent = new BuildQueuedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("mySubject123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + + //replace context id, timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + + @Test + void testBuildStartedCDEvent() throws IOException { + + File buildStartedExample = new File(EXAMPLES_FOLDER + File.separator + "build_started.json"); + JsonNode expectedNode = objectMapper.readTree(buildStartedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + BuildStartedCDEvent expectedEvent = (BuildStartedCDEvent) expectedCDEvent; + + BuildStartedCDEvent createdEvent = new BuildStartedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("mySubject123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + + @Test + void testChangeAbandonedCDEvent() throws IOException { + + File changeAbandonedExample = new File(EXAMPLES_FOLDER + File.separator + "change_abandoned.json"); + JsonNode expectedNode = objectMapper.readTree(changeAbandonedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + ChangeAbandonedCDEvent expectedEvent = (ChangeAbandonedCDEvent) expectedCDEvent; + + ChangeAbandonedCDEvent createdEvent = new ChangeAbandonedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("mySubject123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectRepositoryId("TestRepo/TestOrg"); + createdEvent.setSubjectRepositorySource("https://example.org"); + + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + + @Test + void testChangeCreatedCDEvent() throws IOException { + + File changeCreatedExample = new File(EXAMPLES_FOLDER + File.separator + "change_created.json"); + JsonNode expectedNode = objectMapper.readTree(changeCreatedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + ChangeCreatedCDEvent expectedEvent = (ChangeCreatedCDEvent) expectedCDEvent; + + ChangeCreatedCDEvent createdEvent = new ChangeCreatedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("mySubject123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectRepositoryId("TestRepo/TestOrg"); + createdEvent.setSubjectRepositorySource("https://example.org"); + + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + + @Test + void testChangeMergedCDEvent() throws IOException { + + File changeMergedExample = new File(EXAMPLES_FOLDER + File.separator + "change_merged.json"); + JsonNode expectedNode = objectMapper.readTree(changeMergedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + ChangeMergedCDEvent expectedEvent = (ChangeMergedCDEvent) expectedCDEvent; + + ChangeMergedCDEvent createdEvent = new ChangeMergedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("mySubject123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectRepositoryId("TestRepo/TestOrg"); + createdEvent.setSubjectRepositorySource("https://example.org"); + + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + + @Test + void testChangeReviewedCDEvent() throws IOException { + + File changeReviewedExample = new File(EXAMPLES_FOLDER + File.separator + "change_reviewed.json"); + JsonNode expectedNode = objectMapper.readTree(changeReviewedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + ChangeReviewedCDEvent expectedEvent = (ChangeReviewedCDEvent) expectedCDEvent; + + ChangeReviewedCDEvent createdEvent = new ChangeReviewedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("mySubject123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectRepositoryId("TestRepo/TestOrg"); + createdEvent.setSubjectRepositorySource("https://example.org"); + + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + + @Test + void testChangeUpdatedCDEvent() throws IOException { + + File changeUpdatedExample = new File(EXAMPLES_FOLDER + File.separator + "change_updated.json"); + JsonNode expectedNode = objectMapper.readTree(changeUpdatedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + ChangeUpdatedCDEvent expectedEvent = (ChangeUpdatedCDEvent) expectedCDEvent; + + ChangeUpdatedCDEvent createdEvent = new ChangeUpdatedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("mySubject123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectRepositoryId("TestRepo/TestOrg"); + createdEvent.setSubjectRepositorySource("https://example.org"); + + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + + @Test + void testEnvironmentCreatedCDEvent() throws IOException { + + File environmentCreatedExample = new File(EXAMPLES_FOLDER + File.separator + "environment_created.json"); + JsonNode expectedNode = objectMapper.readTree(environmentCreatedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + EnvironmentCreatedCDEvent expectedEvent = (EnvironmentCreatedCDEvent) expectedCDEvent; + + EnvironmentCreatedCDEvent createdEvent = new EnvironmentCreatedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("mySubject123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectName("testEnv"); + createdEvent.setSubjectUrl("https://example.org/testEnv"); + + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + + @Test + void testEnvironmentDeletedCDEvent() throws IOException { + + File environmentDeletedExample = new File(EXAMPLES_FOLDER + File.separator + "environment_deleted.json"); + JsonNode expectedNode = objectMapper.readTree(environmentDeletedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + EnvironmentDeletedCDEvent expectedEvent = (EnvironmentDeletedCDEvent) expectedCDEvent; + + EnvironmentDeletedCDEvent createdEvent = new EnvironmentDeletedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("mySubject123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectName("testEnv"); + + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + + @Test + void testEnvironmentModifiedCDEvent() throws IOException { + + File environmentModifiedExample = new File(EXAMPLES_FOLDER + File.separator + "environment_modified.json"); + JsonNode expectedNode = objectMapper.readTree(environmentModifiedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + EnvironmentModifiedCDEvent expectedEvent = (EnvironmentModifiedCDEvent) expectedCDEvent; + + EnvironmentModifiedCDEvent createdEvent = new EnvironmentModifiedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("mySubject123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectName("testEnv"); + createdEvent.setSubjectUrl("https://example.org/testEnv"); + + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + + @Test + void testIncidentDetectedCDEvent() throws IOException { + + File incidentDetectedExample = new File(EXAMPLES_FOLDER + File.separator + "incident_detected.json"); + JsonNode expectedNode = objectMapper.readTree(incidentDetectedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + IncidentDetectedCDEvent expectedEvent = (IncidentDetectedCDEvent) expectedCDEvent; + + IncidentDetectedCDEvent createdEvent = new IncidentDetectedCDEvent(); + createdEvent.setSource(URI.create("/monitoring/prod1")); + createdEvent.setSubjectId("incident-123"); + createdEvent.setSubjectSource(URI.create("/monitoring/prod1")); + createdEvent.setSubjectDescription("Response time above threshold of 100ms"); + createdEvent.setSubjectEnvironmentId("prod1"); + createdEvent.setSubjectEnvironmentSource("/iaas/geo1"); + createdEvent.setSubjectServiceId("myApp"); + createdEvent.setSubjectServiceSource("/clusterA/namespaceB"); + createdEvent.setSubjectArtifactId("pkg:oci/myapp@sha256%3A0b31b1c02ff458ad9b7b81cbdf8f028bd54699fa151f221d1e8de6817db93427"); + Map customMap = new HashMap<>(); + customMap.put("metric", "responseTime"); + customMap.put("threshold", "100ms"); + customMap.put("value", "200ms"); + createdEvent.setCustomData(customMap); + + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + assertEquals(expectedEvent.getCustomData(), createdEvent.getCustomData()); + assertEquals(expectedEvent.getCustomDataContentType(), createdEvent.getCustomDataContentType()); + } + + @Test + void testIncidentReportedCDEvent() throws IOException { + + File incidentReportedExample = new File(EXAMPLES_FOLDER + File.separator + "incident_reported.json"); + JsonNode expectedNode = objectMapper.readTree(incidentReportedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + IncidentReportedCDEvent expectedEvent = (IncidentReportedCDEvent) expectedCDEvent; + + IncidentReportedCDEvent createdEvent = new IncidentReportedCDEvent(); + createdEvent.setSource(URI.create("/monitoring/prod1")); + createdEvent.setSubjectId("incident-123"); + createdEvent.setSubjectSource(URI.create("/monitoring/prod1")); + createdEvent.setSubjectDescription("Response time above threshold of 100ms"); + createdEvent.setSubjectEnvironmentId("prod1"); + createdEvent.setSubjectEnvironmentSource("/iaas/geo1"); + createdEvent.setSubjectServiceId("myApp"); + createdEvent.setSubjectServiceSource("/clusterA/namespaceB"); + createdEvent.setSubjectArtifactId("pkg:oci/myapp@sha256%3A0b31b1c02ff458ad9b7b81cbdf8f028bd54699fa151f221d1e8de6817db93427"); + createdEvent.setSubjectTicketURI(URI.create("https://my-issues.example/incidents/ticket-345")); + Map customMap = new HashMap<>(); + customMap.put("severity", "medium"); + customMap.put("priority", "critical"); + customMap.put("reportedBy", "userId"); + createdEvent.setCustomData(customMap); + + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + assertEquals(expectedEvent.getCustomData(), createdEvent.getCustomData()); + assertEquals(expectedEvent.getCustomDataContentType(), createdEvent.getCustomDataContentType()); + } + + @Test + void testIncidentResolvedCDEvent() throws IOException { + + File incidentResolvedExample = new File(EXAMPLES_FOLDER + File.separator + "incident_resolved.json"); + JsonNode expectedNode = objectMapper.readTree(incidentResolvedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + IncidentResolvedCDEvent expectedEvent = (IncidentResolvedCDEvent) expectedCDEvent; + + IncidentResolvedCDEvent createdEvent = new IncidentResolvedCDEvent(); + createdEvent.setSource(URI.create("/monitoring/prod1")); + createdEvent.setSubjectId("incident-123"); + createdEvent.setSubjectSource(URI.create("/monitoring/prod1")); + createdEvent.setSubjectDescription("Response time restored below 100ms"); + createdEvent.setSubjectEnvironmentId("prod1"); + createdEvent.setSubjectEnvironmentSource("/iaas/geo1"); + createdEvent.setSubjectServiceId("myApp"); + createdEvent.setSubjectServiceSource("/clusterA/namespaceB"); + createdEvent.setSubjectArtifactId("pkg:oci/myapp@sha256%3A0b31b1c02ff458ad9b7b81cbdf8f028bd54699fa151f221d1e8de6817db93439"); + Map customMap = new HashMap<>(); + customMap.put("metric", "responseTime"); + customMap.put("threshold", "100ms"); + customMap.put("value", "70ms"); + createdEvent.setCustomData(customMap); + + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + assertEquals(expectedEvent.getCustomData(), createdEvent.getCustomData()); + assertEquals(expectedEvent.getCustomDataContentType(), createdEvent.getCustomDataContentType()); + } + + @Test + void testPipelinerunFinishedCDEvent() throws IOException { + + File pipelinerunFinishedExample = new File(EXAMPLES_FOLDER + File.separator + "pipelinerun_finished.json"); + JsonNode expectedNode = objectMapper.readTree(pipelinerunFinishedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + PipelinerunFinishedCDEvent expectedEvent = (PipelinerunFinishedCDEvent) expectedCDEvent; + + PipelinerunFinishedCDEvent createdEvent = new PipelinerunFinishedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("mySubject123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectPipelineName("myPipeline"); + createdEvent.setSubjectUrl("https://www.example.com/mySubject123"); + createdEvent.setSubjectOutcome("failure"); + createdEvent.setSubjectErrors("Something went wrong\nWith some more details"); + + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + + @Test + void testPipelinerunQueuedCDEvent() throws IOException { + + File pipelinerunQueuedExample = new File(EXAMPLES_FOLDER + File.separator + "pipelinerun_queued.json"); + JsonNode expectedNode = objectMapper.readTree(pipelinerunQueuedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + PipelinerunQueuedCDEvent expectedEvent = (PipelinerunQueuedCDEvent) expectedCDEvent; + + PipelinerunQueuedCDEvent createdEvent = new PipelinerunQueuedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("mySubject123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectPipelineName("myPipeline"); + createdEvent.setSubjectUrl("https://www.example.com/mySubject123"); + + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + @Test + void testPipelinerunStartedCDEvent() throws IOException { + + File pipelinerunStartedExample = new File(EXAMPLES_FOLDER + File.separator + "pipelinerun_started.json"); + JsonNode expectedNode = objectMapper.readTree(pipelinerunStartedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + PipelinerunStartedCDEvent expectedEvent = (PipelinerunStartedCDEvent) expectedCDEvent; + + PipelinerunStartedCDEvent createdEvent = new PipelinerunStartedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("mySubject123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectPipelineName("myPipeline"); + createdEvent.setSubjectUrl("https://www.example.com/mySubject123"); + + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + + @Test + void testRepositoryCreatedCDEvent() throws IOException { + + File repositoryCreatedExample = new File(EXAMPLES_FOLDER + File.separator + "repository_created.json"); + JsonNode expectedNode = objectMapper.readTree(repositoryCreatedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + RepositoryCreatedCDEvent expectedEvent = (RepositoryCreatedCDEvent) expectedCDEvent; + + RepositoryCreatedCDEvent createdEvent = new RepositoryCreatedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("mySubject123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectName("TestRepo"); + createdEvent.setSubjectOwner("TestOrg"); + createdEvent.setSubjectUrl("https://example.org/TestOrg/TestRepo"); + createdEvent.setSubjectViewUrl("https://example.org/view/TestOrg/TestRepo"); + + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + + @Test + void testRepositoryDeletedCDEvent() throws IOException { + + File repositoryDeletedExample = new File(EXAMPLES_FOLDER + File.separator + "repository_deleted.json"); + JsonNode expectedNode = objectMapper.readTree(repositoryDeletedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + RepositoryDeletedCDEvent expectedEvent = (RepositoryDeletedCDEvent) expectedCDEvent; + + RepositoryDeletedCDEvent createdEvent = new RepositoryDeletedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("mySubject123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectName("TestRepo"); + createdEvent.setSubjectOwner("TestOrg"); + createdEvent.setSubjectUrl("https://example.org/TestOrg/TestRepo"); + createdEvent.setSubjectViewUrl("https://example.org/view/TestOrg/TestRepo"); + + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + @Test + void testRepositoryModifiedCDEvent() throws IOException { + + File repositoryModifiedExample = new File(EXAMPLES_FOLDER + File.separator + "repository_modified.json"); + JsonNode expectedNode = objectMapper.readTree(repositoryModifiedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + RepositoryModifiedCDEvent expectedEvent = (RepositoryModifiedCDEvent) expectedCDEvent; + + RepositoryModifiedCDEvent createdEvent = new RepositoryModifiedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("mySubject123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectName("TestRepo"); + createdEvent.setSubjectOwner("TestOrg"); + createdEvent.setSubjectUrl("https://example.org/TestOrg/TestRepo"); + createdEvent.setSubjectViewUrl("https://example.org/view/TestOrg/TestRepo"); + + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + + @Test + void testServiceDeployedCDEvent() throws IOException { + + File serviceDeployedExample = new File(EXAMPLES_FOLDER + File.separator + "service_deployed.json"); + JsonNode expectedNode = objectMapper.readTree(serviceDeployedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + ServiceDeployedCDEvent expectedEvent = (ServiceDeployedCDEvent) expectedCDEvent; + + ServiceDeployedCDEvent createdEvent = new ServiceDeployedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("mySubject123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectEnvironmentId("test123"); + createdEvent.setSubjectArtifactId("pkg:oci/myapp@sha256%3A0b31b1c02ff458ad9b7b81cbdf8f028bd54699fa151f221d1e8de6817db93427"); + + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + @Test + void testServicePublishedCDEvent() throws IOException { + + File servicePublishedExample = new File(EXAMPLES_FOLDER + File.separator + "service_published.json"); + JsonNode expectedNode = objectMapper.readTree(servicePublishedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + ServicePublishedCDEvent expectedEvent = (ServicePublishedCDEvent) expectedCDEvent; + + ServicePublishedCDEvent createdEvent = new ServicePublishedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("mySubject123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectEnvironmentId("test123"); + + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + + @Test + void testServiceRemovedCDEvent() throws IOException { + + File serviceRemovedExample = new File(EXAMPLES_FOLDER + File.separator + "service_removed.json"); + JsonNode expectedNode = objectMapper.readTree(serviceRemovedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + ServiceRemovedCDEvent expectedEvent = (ServiceRemovedCDEvent) expectedCDEvent; + + ServiceRemovedCDEvent createdEvent = new ServiceRemovedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("mySubject123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectEnvironmentId("test123"); + + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + + @Test + void testServiceRolledbackCDEvent() throws IOException { + + File serviceRolledbackExample = new File(EXAMPLES_FOLDER + File.separator + "service_rolledback.json"); + JsonNode expectedNode = objectMapper.readTree(serviceRolledbackExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + ServiceRolledbackCDEvent expectedEvent = (ServiceRolledbackCDEvent) expectedCDEvent; + + ServiceRolledbackCDEvent createdEvent = new ServiceRolledbackCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("mySubject123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectEnvironmentId("test123"); + createdEvent.setSubjectArtifactId("pkg:oci/myapp@sha256%3A0b31b1c02ff458ad9b7b81cbdf8f028bd54699fa151f221d1e8de6817db93427"); + + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + + @Test + void testServiceUpgradedCDEvent() throws IOException { + + File serviceUpgradedExample = new File(EXAMPLES_FOLDER + File.separator + "service_upgraded.json"); + JsonNode expectedNode = objectMapper.readTree(serviceUpgradedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + ServiceUpgradedCDEvent expectedEvent = (ServiceUpgradedCDEvent) expectedCDEvent; + + ServiceUpgradedCDEvent createdEvent = new ServiceUpgradedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("mySubject123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectEnvironmentId("test123"); + createdEvent.setSubjectArtifactId("pkg:oci/myapp@sha256%3A0b31b1c02ff458ad9b7b81cbdf8f028bd54699fa151f221d1e8de6817db93427"); + + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + + @Test + void testTaskrunFinishedCDEvent() throws IOException { + + File taskrunFinishedExample = new File(EXAMPLES_FOLDER + File.separator + "taskrun_finished.json"); + JsonNode expectedNode = objectMapper.readTree(taskrunFinishedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + TaskrunFinishedCDEvent expectedEvent = (TaskrunFinishedCDEvent) expectedCDEvent; + + TaskrunFinishedCDEvent createdEvent = new TaskrunFinishedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("mySubject123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectTaskName("myTask"); + createdEvent.setSubjectUrl("https://www.example.com/mySubject123"); + createdEvent.setSubjectPipelineRunId("mySubject123"); + createdEvent.setSubjectOutcome("failure"); + createdEvent.setSubjectErrors("Something went wrong\nWith some more details"); + + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + + @Test + void testTaskrunStartedCDEvent() throws IOException { + + File taskrunStartedExample = new File(EXAMPLES_FOLDER + File.separator + "taskrun_started.json"); + JsonNode expectedNode = objectMapper.readTree(taskrunStartedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + TaskrunStartedCDEvent expectedEvent = (TaskrunStartedCDEvent) expectedCDEvent; + + TaskrunStartedCDEvent createdEvent = new TaskrunStartedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("mySubject123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectTaskName("myTask"); + createdEvent.setSubjectUrl("https://www.example.com/mySubject123"); + createdEvent.setSubjectPipelineRunId("mySubject123"); + + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + + @Test + void testTestcaserunFinishedCDEvent() throws IOException { + + File testcaserunFinishedExample = new File(EXAMPLES_FOLDER + File.separator + "testcaserun_finished.json"); + JsonNode expectedNode = objectMapper.readTree(testcaserunFinishedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + TestcaserunFinishedCDEvent expectedEvent = (TestcaserunFinishedCDEvent) expectedCDEvent; + + TestcaserunFinishedCDEvent createdEvent = new TestcaserunFinishedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("myTestCaseRun123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectOutcome(Content.Outcome.PASS); + createdEvent.setSubjectEnvironmentId("dev"); + createdEvent.setSubjectEnvironmentSource("testkube-dev-123"); + createdEvent.setSubjectTestCaseId("92834723894"); + createdEvent.setSubjectTestCaseVersion("1.0"); + createdEvent.setSubjectTestCaseName("Login Test"); + createdEvent.setSubjectTestCaseType(TestCase.Type.INTEGRATION); + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject().getContent().getOutcome(), createdEvent.getSubject().getContent().getOutcome()); + assertEquals(expectedEvent.getSubject().getContent().getTestCase(), createdEvent.getSubject().getContent().getTestCase()); + assertEquals(expectedEvent.getSubject().getContent().getEnvironment(), createdEvent.getSubject().getContent().getEnvironment()); + } + + @Test + void testTestcaserunQueuedCDEvent() throws IOException { + + File testcaserunQueuedExample = new File(EXAMPLES_FOLDER + File.separator + "testcaserun_queued.json"); + JsonNode expectedNode = objectMapper.readTree(testcaserunQueuedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + TestcaserunQueuedCDEvent expectedEvent = (TestcaserunQueuedCDEvent) expectedCDEvent; + + TestcaserunQueuedCDEvent createdEvent = new TestcaserunQueuedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("myTestCaseRun123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectEnvironmentId("dev"); + createdEvent.setSubjectEnvironmentSource("testkube-dev-123"); + createdEvent.setSubjectTestCaseId("92834723894"); + createdEvent.setSubjectTestCaseVersion("1.0"); + createdEvent.setSubjectTestCaseName("Login Test"); + createdEvent.setSubjectTestCaseType(dev.cdevents.models.testcaserun.queued.TestCase.Type.INTEGRATION); + createdEvent.setSubjectTriggerType(Trigger.Type.SCHEDULE); + + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject().getContent().getTrigger(), createdEvent.getSubject().getContent().getTrigger()); + assertEquals(expectedEvent.getSubject().getContent().getTestCase(), createdEvent.getSubject().getContent().getTestCase()); + assertEquals(expectedEvent.getSubject().getContent().getEnvironment(), createdEvent.getSubject().getContent().getEnvironment()); + } + + @Test + void testTestcaserunStartedCDEvent() throws IOException { + + File testcaserunStartedExample = new File(EXAMPLES_FOLDER + File.separator + "testcaserun_started.json"); + JsonNode expectedNode = objectMapper.readTree(testcaserunStartedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + TestcaserunStartedCDEvent expectedEvent = (TestcaserunStartedCDEvent) expectedCDEvent; + + TestcaserunStartedCDEvent createdEvent = new TestcaserunStartedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("myTestCaseRun123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectEnvironmentId("dev"); + createdEvent.setSubjectEnvironmentSource("testkube-dev-123"); + createdEvent.setSubjectTestCaseId("92834723894"); + createdEvent.setSubjectTestCaseVersion("1.0"); + createdEvent.setSubjectTestCaseName("Login Test"); + createdEvent.setSubjectTestCaseType(dev.cdevents.models.testcaserun.started.TestCase.Type.INTEGRATION); + createdEvent.setSubjectTriggerType(dev.cdevents.models.testcaserun.started.Trigger.Type.SCHEDULE); + + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject().getContent().getTrigger(), createdEvent.getSubject().getContent().getTrigger()); + assertEquals(expectedEvent.getSubject().getContent().getTestCase(), createdEvent.getSubject().getContent().getTestCase()); + assertEquals(expectedEvent.getSubject().getContent().getEnvironment(), createdEvent.getSubject().getContent().getEnvironment()); + } + + @Test + void testTestoutputPublishedCDEvent() throws IOException { + + File testoutputPublishedExample = new File(EXAMPLES_FOLDER + File.separator + "testoutput_published.json"); + JsonNode expectedNode = objectMapper.readTree(testoutputPublishedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + TestoutputPublishedCDEvent expectedEvent = (TestoutputPublishedCDEvent) expectedCDEvent; + + TestoutputPublishedCDEvent createdEvent = new TestoutputPublishedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("testrunreport-12123"); + createdEvent.setSubjectSource(URI.create("/event/source/testrunreport-12123")); + createdEvent.setSubjectOutputType(dev.cdevents.models.testoutput.published.Content.OutputType.VIDEO); + createdEvent.setSubjectFormat("video/quicktime"); + createdEvent.setSubjectTestCaseRunId("myTestCaseRun123"); + createdEvent.setSubjectTestCaseRunSource("testkube-dev-123"); + + + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + + @Test + void testTestsuiterunFinishedCDEvent() throws IOException { + + File testsuiterunFinishedExample = new File(EXAMPLES_FOLDER + File.separator + "testsuiterun_finished.json"); + JsonNode expectedNode = objectMapper.readTree(testsuiterunFinishedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + TestsuiterunFinishedCDEvent expectedEvent = (TestsuiterunFinishedCDEvent) expectedCDEvent; + + TestsuiterunFinishedCDEvent createdEvent = new TestsuiterunFinishedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("myTestSuiteRun123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectOutcome(dev.cdevents.models.testsuiterun.finished.Content.Outcome.FAIL); + createdEvent.setSubjectSeverity(dev.cdevents.models.testsuiterun.finished.Content.Severity.CRITICAL); + createdEvent.setSubjectReason("Host 123.34.23.32 not found"); + createdEvent.setSubjectEnvironmentId("dev"); + createdEvent.setSubjectEnvironmentSource("testkube-dev-123"); + createdEvent.setSubjectTestSuiteId("92834723894"); + createdEvent.setSubjectTestSuiteVersion("1.0"); + createdEvent.setSubjectTestSuiteName("Auth TestSuite"); + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + + @Test + void testTestsuiterunQueuedCDEvent() throws IOException { + + File testsuiterunQueuedExample = new File(EXAMPLES_FOLDER + File.separator + "testsuiterun_queued.json"); + JsonNode expectedNode = objectMapper.readTree(testsuiterunQueuedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + TestsuiterunQueuedCDEvent expectedEvent = (TestsuiterunQueuedCDEvent) expectedCDEvent; + + TestsuiterunQueuedCDEvent createdEvent = new TestsuiterunQueuedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("myTestSuiteRun123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectEnvironmentId("dev"); + createdEvent.setSubjectEnvironmentSource("testkube-dev-123"); + createdEvent.setSubjectTestSuiteId("92834723894"); + createdEvent.setSubjectTestSuiteVersion("1.0"); + createdEvent.setSubjectTestSuiteName("Auth TestSuite"); + createdEvent.setSubjectTriggerType(dev.cdevents.models.testsuiterun.queued.Trigger.Type.PIPELINE); + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } + + @Test + void testTestsuiterunStartedCDEvent() throws IOException { + + File testsuiterunStartedExample = new File(EXAMPLES_FOLDER + File.separator + "testsuiterun_started.json"); + JsonNode expectedNode = objectMapper.readTree(testsuiterunStartedExample); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + CDEvent expectedCDEvent = CDEvents.cdEventFromJson(expectedJson); + TestsuiterunStartedCDEvent expectedEvent = (TestsuiterunStartedCDEvent) expectedCDEvent; + + TestsuiterunStartedCDEvent createdEvent = new TestsuiterunStartedCDEvent(); + createdEvent.setSource(URI.create("/event/source/123")); + createdEvent.setSubjectId("myTestSuiteRun123"); + createdEvent.setSubjectSource(URI.create("/event/source/123")); + createdEvent.setSubjectEnvironmentId("dev"); + createdEvent.setSubjectEnvironmentSource("testkube-dev-123"); + createdEvent.setSubjectTestSuiteId("92834723894"); + createdEvent.setSubjectTestSuiteVersion("1.0"); + createdEvent.setSubjectTestSuiteName("Auth TestSuite"); + createdEvent.setSubjectTriggerType(dev.cdevents.models.testsuiterun.started.Trigger.Type.PIPELINE); + //replace createdEvent's context id and timestamp from the expectedEvent to compare objects directly + createdEvent.getContext().setId(expectedEvent.getContext().getId()); + createdEvent.getContext().setTimestamp(expectedEvent.getContext().getTimestamp()); + + assertEquals(expectedEvent.getContext(), createdEvent.getContext()); + assertEquals(expectedEvent.getSubject(), createdEvent.getSubject()); + } +} diff --git a/sdk/src/test/java/dev/cdevents/CDEventsTest.java b/sdk/src/test/java/dev/cdevents/CDEventsTest.java index ece4a20..527d1ad 100644 --- a/sdk/src/test/java/dev/cdevents/CDEventsTest.java +++ b/sdk/src/test/java/dev/cdevents/CDEventsTest.java @@ -8,7 +8,6 @@ import dev.cdevents.constants.CDEventConstants; import dev.cdevents.events.*; import dev.cdevents.exception.CDEventsException; -import dev.cdevents.models.incident.detected.Incidentdetected; import dev.cdevents.models.testcaserun.finished.Content; import io.cloudevents.CloudEvent; import org.junit.jupiter.api.Test; @@ -1606,4 +1605,45 @@ void testInvalidIncidentResolvedEventWithNoSubject() { assertThat(exception.getMessage()).isEqualTo(expectedError); } + + @Test + void testInvalidArtifactPackagedEventJson() throws IOException { + InputStream inputStream = getClass().getResourceAsStream("/artifact_packaged_with_no_content.json"); + JsonNode expectedNode = objectMapper.readTree(inputStream); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + + Exception exception = assertThrows(CDEventsException.class, () -> { + CDEvents.cdEventFromJson(expectedJson); + }); + String expectedError = "CDEvent Json validation failed against schema"; + + assertThat(exception.getMessage()).isEqualTo(expectedError); + } + + @Test + void testInvalidArtifactPublishedEventJson() throws IOException { + InputStream inputStream = getClass().getResourceAsStream("/artifact_published_with_no_context.json"); + JsonNode expectedNode = objectMapper.readTree(inputStream); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + + Exception exception = assertThrows(CDEventsException.class, () -> { + CDEvents.cdEventFromJson(expectedJson); + }); + String expectedError = "Unable to find context and type in CDEvent Json"; + + assertThat(exception.getMessage()).isEqualTo(expectedError); + } + @Test + void testInvalidArtifactSignedEventJson() throws IOException { + InputStream inputStream = getClass().getResourceAsStream("/artifact_signed_with_invalid_type.json"); + JsonNode expectedNode = objectMapper.readTree(inputStream); + String expectedJson = objectMapper.writeValueAsString(expectedNode); + + Exception exception = assertThrows(CDEventsException.class, () -> { + CDEvents.cdEventFromJson(expectedJson); + }); + String expectedError = "Invalid CDEvent type found from cdEventJson"; + + assertThat(exception.getMessage()).isEqualTo(expectedError); + } } diff --git a/sdk/src/test/resources/artifact_packaged_with_no_content.json b/sdk/src/test/resources/artifact_packaged_with_no_content.json new file mode 100644 index 0000000..5069e45 --- /dev/null +++ b/sdk/src/test/resources/artifact_packaged_with_no_content.json @@ -0,0 +1,14 @@ +{ + "context": { + "version": "0.3.0", + "id": "271069a8-fc18-44f1-b38f-9d70a1695819", + "source": "/event/source/123", + "type": "dev.cdevents.artifact.packaged.0.1.1", + "timestamp": "2023-03-20T14:27:05.315384Z" + }, + "subject": { + "id": "pkg:golang/mygit.com/myorg/myapp@234fd47e07d1004f0aed9c", + "source": "/event/source/123", + "type": "artifact" + } +} diff --git a/sdk/src/test/resources/artifact_published_with_no_context.json b/sdk/src/test/resources/artifact_published_with_no_context.json new file mode 100644 index 0000000..6c2a7b2 --- /dev/null +++ b/sdk/src/test/resources/artifact_published_with_no_context.json @@ -0,0 +1,8 @@ +{ + "subject": { + "id": "pkg:golang/mygit.com/myorg/myapp@234fd47e07d1004f0aed9c", + "source": "/event/source/123", + "type": "artifact", + "content": {} + } +} diff --git a/sdk/src/test/resources/artifact_signed_with_invalid_type.json b/sdk/src/test/resources/artifact_signed_with_invalid_type.json new file mode 100644 index 0000000..1eb47c3 --- /dev/null +++ b/sdk/src/test/resources/artifact_signed_with_invalid_type.json @@ -0,0 +1,17 @@ +{ + "context": { + "version": "0.3.0", + "id": "271069a8-fc18-44f1-b38f-9d70a1695819", + "source": "/event/source/123", + "type": "dev.cdevents.artifact.invalid.0.1.0", + "timestamp": "2023-03-20T14:27:05.315384Z" + }, + "subject": { + "id": "pkg:golang/mygit.com/myorg/myapp@234fd47e07d1004f0aed9c", + "source": "/event/source/123", + "type": "artifact", + "content": { + "signature": "MEYCIQCBT8U5ypDXWCjlNKfzTV4KH516/SK13NZSh8znnSMNkQIhAJ3XiQlc9PM1KyjITcZXHotdMB+J3NGua5T/yshmiPmp" + } + } +}