From 6a2192c4be43c8e95306d174b326e318b3d60580 Mon Sep 17 00:00:00 2001 From: samatstarion Date: Thu, 5 Feb 2026 12:01:55 +0100 Subject: [PATCH 1/2] [Add] generator and generated DTO Comparer classes; fixes #60 [Add] GuidSequenceEquality, StringSequenceEquality, FloatingPointComparer --- .../AnnotatingElementComparer.cs | 124 +++++++ .../AssociationComparer.cs | 134 +++++++ .../AutoGenDtoComparers/DependencyComparer.cs | 134 +++++++ .../EnumerationDefinitionComparer.cs | 130 +++++++ .../AutoGenDtoComparers/FeatureComparer.cs | 147 ++++++++ .../FeatureTypingComparer.cs | 134 +++++++ .../Core/AutoGenDtoComparers/FlowComparer.cs | 153 ++++++++ .../FramedConcernMembershipComparer.cs | 136 +++++++ .../LiteralIntegerComparer.cs | 149 ++++++++ .../LiteralRationalComparer.cs | 149 ++++++++ .../AutoGenDtoComparers/MembershipComparer.cs | 139 ++++++++ .../MultiplicityRangeComparer.cs | 147 ++++++++ .../OwningMembershipComparer.cs | 133 +++++++ .../ReferenceSubsettingComparer.cs | 132 +++++++ .../RequirementUsageComparer.cs | 152 ++++++++ .../SelectExpressionComparer.cs | 149 ++++++++ .../SubclassificationComparer.cs | 134 +++++++ .../TextualRepresentationComparer.cs | 128 +++++++ .../Core/AutoGenDtoComparers/UsageComparer.cs | 147 ++++++++ .../UmlCoreDtoComparerGeneratorTestFixture.cs | 79 +++++ .../SysML2.NET.CodeGenerator.Tests.csproj | 76 ++++ .../UmlCoreDtoComparerGenerator.cs | 229 ++++++++++++ .../HandleBarHelpers/PropertyHelper.cs | 98 +++++- .../SysML2.NET.CodeGenerator.csproj | 6 + .../core-dto-comparer-class-uml-template.hbs | 116 ++++++ ...core-dto-comparerprovider-uml-template.hbs | 169 +++++++++ .../FloatingPointComparerTestFixture.cs | 201 +++++++++++ .../Comparers/GuidComparerTestFixture.cs | 129 +++++++ .../GuidSequenceEqualityTestFixture.cs | 182 ++++++++++ .../StringSequenceEqualityTestFixture.cs | 204 +++++++++++ .../Comparers/FloatingPointComparer.cs | 77 ++++ .../Comparers/GuidSequenceEquality.cs | 130 +++++++ .../Comparers/StringSequenceEquality.cs | 113 ++++++ .../AcceptActionUsageComparer.cs | 152 ++++++++ .../ActionDefinitionComparer.cs | 132 +++++++ .../ActionUsageComparer.cs | 152 ++++++++ .../ActorMembershipComparer.cs | 133 +++++++ .../AllocationDefinitionComparer.cs | 138 ++++++++ .../AllocationUsageComparer.cs | 158 +++++++++ .../AnalysisCaseDefinitionComparer.cs | 132 +++++++ .../AnalysisCaseUsageComparer.cs | 152 ++++++++ .../AnnotatingElementComparer.cs | 124 +++++++ .../AutoGenDtoComparers/AnnotationComparer.cs | 132 +++++++ .../AssertConstraintUsageComparer.cs | 154 ++++++++ .../AssignmentActionUsageComparer.cs | 152 ++++++++ .../AssociationComparer.cs | 134 +++++++ .../AssociationStructureComparer.cs | 134 +++++++ .../AttributeDefinitionComparer.cs | 130 +++++++ .../AttributeUsageComparer.cs | 147 ++++++++ .../AutoGenDtoComparers/BehaviorComparer.cs | 128 +++++++ .../BindingConnectorAsUsageComparer.cs | 153 ++++++++ .../BindingConnectorComparer.cs | 153 ++++++++ .../BooleanExpressionComparer.cs | 147 ++++++++ .../CalculationDefinitionComparer.cs | 132 +++++++ .../CalculationUsageComparer.cs | 152 ++++++++ .../CaseDefinitionComparer.cs | 132 +++++++ .../AutoGenDtoComparers/CaseUsageComparer.cs | 152 ++++++++ .../Core/AutoGenDtoComparers/ClassComparer.cs | 128 +++++++ .../AutoGenDtoComparers/ClassifierComparer.cs | 128 +++++++ .../CollectExpressionComparer.cs | 149 ++++++++ .../AutoGenDtoComparers/CommentComparer.cs | 128 +++++++ .../AutoGenDtoComparers/ComparerProvider.cs | 333 ++++++++++++++++++ .../ConcernDefinitionComparer.cs | 132 +++++++ .../ConcernUsageComparer.cs | 152 ++++++++ .../ConjugatedPortDefinitionComparer.cs | 132 +++++++ .../ConjugatedPortTypingComparer.cs | 134 +++++++ .../ConjugationComparer.cs | 134 +++++++ .../ConnectionDefinitionComparer.cs | 138 ++++++++ .../ConnectionUsageComparer.cs | 158 +++++++++ .../AutoGenDtoComparers/ConnectorComparer.cs | 153 ++++++++ .../ConstraintDefinitionComparer.cs | 132 +++++++ .../ConstraintUsageComparer.cs | 152 ++++++++ .../ConstructorExpressionComparer.cs | 147 ++++++++ .../CrossSubsettingComparer.cs | 132 +++++++ .../AutoGenDtoComparers/DataTypeComparer.cs | 128 +++++++ .../DecisionNodeComparer.cs | 152 ++++++++ .../AutoGenDtoComparers/DefinitionComparer.cs | 130 +++++++ .../AutoGenDtoComparers/DependencyComparer.cs | 134 +++++++ .../DifferencingComparer.cs | 132 +++++++ .../AutoGenDtoComparers/DisjoiningComparer.cs | 134 +++++++ .../DocumentationComparer.cs | 128 +++++++ .../ElementFilterMembershipComparer.cs | 133 +++++++ .../EndFeatureMembershipComparer.cs | 133 +++++++ .../EnumerationDefinitionComparer.cs | 130 +++++++ .../EnumerationUsageComparer.cs | 147 ++++++++ .../EventOccurrenceUsageComparer.cs | 152 ++++++++ .../ExhibitStateUsageComparer.cs | 154 ++++++++ .../AutoGenDtoComparers/ExpressionComparer.cs | 147 ++++++++ .../FeatureChainExpressionComparer.cs | 149 ++++++++ .../FeatureChainingComparer.cs | 132 +++++++ .../AutoGenDtoComparers/FeatureComparer.cs | 147 ++++++++ .../FeatureInvertingComparer.cs | 134 +++++++ .../FeatureMembershipComparer.cs | 133 +++++++ .../FeatureReferenceExpressionComparer.cs | 147 ++++++++ .../FeatureTypingComparer.cs | 134 +++++++ .../FeatureValueComparer.cs | 137 +++++++ .../Core/AutoGenDtoComparers/FlowComparer.cs | 153 ++++++++ .../FlowDefinitionComparer.cs | 138 ++++++++ .../AutoGenDtoComparers/FlowEndComparer.cs | 147 ++++++++ .../AutoGenDtoComparers/FlowUsageComparer.cs | 158 +++++++++ .../ForLoopActionUsageComparer.cs | 152 ++++++++ .../AutoGenDtoComparers/ForkNodeComparer.cs | 152 ++++++++ .../FramedConcernMembershipComparer.cs | 136 +++++++ .../AutoGenDtoComparers/FunctionComparer.cs | 128 +++++++ .../IfActionUsageComparer.cs | 152 ++++++++ .../IncludeUseCaseUsageComparer.cs | 152 ++++++++ .../IndexExpressionComparer.cs | 149 ++++++++ .../InteractionComparer.cs | 134 +++++++ .../InterfaceDefinitionComparer.cs | 138 ++++++++ .../InterfaceUsageComparer.cs | 158 +++++++++ .../IntersectingComparer.cs | 132 +++++++ .../AutoGenDtoComparers/InvariantComparer.cs | 149 ++++++++ .../InvocationExpressionComparer.cs | 147 ++++++++ .../ItemDefinitionComparer.cs | 132 +++++++ .../AutoGenDtoComparers/ItemUsageComparer.cs | 152 ++++++++ .../AutoGenDtoComparers/JoinNodeComparer.cs | 152 ++++++++ .../LibraryPackageComparer.cs | 126 +++++++ .../LiteralBooleanComparer.cs | 149 ++++++++ .../LiteralExpressionComparer.cs | 147 ++++++++ .../LiteralInfinityComparer.cs | 147 ++++++++ .../LiteralIntegerComparer.cs | 149 ++++++++ .../LiteralRationalComparer.cs | 149 ++++++++ .../LiteralStringComparer.cs | 149 ++++++++ .../AutoGenDtoComparers/MembershipComparer.cs | 139 ++++++++ .../MembershipExposeComparer.cs | 139 ++++++++ .../MembershipImportComparer.cs | 139 ++++++++ .../AutoGenDtoComparers/MergeNodeComparer.cs | 152 ++++++++ .../AutoGenDtoComparers/MetaclassComparer.cs | 128 +++++++ .../MetadataAccessExpressionComparer.cs | 147 ++++++++ .../MetadataDefinitionComparer.cs | 132 +++++++ .../MetadataFeatureComparer.cs | 147 ++++++++ .../MetadataUsageComparer.cs | 152 ++++++++ .../MultiplicityComparer.cs | 147 ++++++++ .../MultiplicityRangeComparer.cs | 147 ++++++++ .../AutoGenDtoComparers/NamespaceComparer.cs | 124 +++++++ .../NamespaceExposeComparer.cs | 139 ++++++++ .../NamespaceImportComparer.cs | 139 ++++++++ .../NullExpressionComparer.cs | 147 ++++++++ .../ObjectiveMembershipComparer.cs | 133 +++++++ .../OccurrenceDefinitionComparer.cs | 132 +++++++ .../OccurrenceUsageComparer.cs | 152 ++++++++ .../OperatorExpressionComparer.cs | 149 ++++++++ .../OwningMembershipComparer.cs | 133 +++++++ .../AutoGenDtoComparers/PackageComparer.cs | 124 +++++++ .../ParameterMembershipComparer.cs | 133 +++++++ .../PartDefinitionComparer.cs | 132 +++++++ .../AutoGenDtoComparers/PartUsageComparer.cs | 152 ++++++++ .../PayloadFeatureComparer.cs | 147 ++++++++ .../PerformActionUsageComparer.cs | 152 ++++++++ .../PortConjugationComparer.cs | 134 +++++++ .../PortDefinitionComparer.cs | 132 +++++++ .../AutoGenDtoComparers/PortUsageComparer.cs | 152 ++++++++ .../AutoGenDtoComparers/PredicateComparer.cs | 128 +++++++ .../RedefinitionComparer.cs | 134 +++++++ .../ReferenceSubsettingComparer.cs | 132 +++++++ .../ReferenceUsageComparer.cs | 147 ++++++++ .../RenderingDefinitionComparer.cs | 132 +++++++ .../RenderingUsageComparer.cs | 152 ++++++++ ...RequirementConstraintMembershipComparer.cs | 136 +++++++ .../RequirementDefinitionComparer.cs | 132 +++++++ .../RequirementUsageComparer.cs | 152 ++++++++ ...quirementVerificationMembershipComparer.cs | 136 +++++++ .../ResultExpressionMembershipComparer.cs | 133 +++++++ .../ReturnParameterMembershipComparer.cs | 133 +++++++ .../SatisfyRequirementUsageComparer.cs | 154 ++++++++ .../SelectExpressionComparer.cs | 149 ++++++++ .../SendActionUsageComparer.cs | 152 ++++++++ .../SpecializationComparer.cs | 134 +++++++ .../StakeholderMembershipComparer.cs | 133 +++++++ .../StateDefinitionComparer.cs | 134 +++++++ .../StateSubactionMembershipComparer.cs | 136 +++++++ .../AutoGenDtoComparers/StateUsageComparer.cs | 154 ++++++++ .../Core/AutoGenDtoComparers/StepComparer.cs | 147 ++++++++ .../AutoGenDtoComparers/StructureComparer.cs | 128 +++++++ .../SubclassificationComparer.cs | 134 +++++++ .../SubjectMembershipComparer.cs | 133 +++++++ .../AutoGenDtoComparers/SubsettingComparer.cs | 134 +++++++ .../SuccessionAsUsageComparer.cs | 153 ++++++++ .../AutoGenDtoComparers/SuccessionComparer.cs | 153 ++++++++ .../SuccessionFlowComparer.cs | 153 ++++++++ .../SuccessionFlowUsageComparer.cs | 158 +++++++++ .../TerminateActionUsageComparer.cs | 152 ++++++++ .../TextualRepresentationComparer.cs | 128 +++++++ .../TransitionFeatureMembershipComparer.cs | 136 +++++++ .../TransitionUsageComparer.cs | 152 ++++++++ .../TriggerInvocationExpressionComparer.cs | 150 ++++++++ .../Core/AutoGenDtoComparers/TypeComparer.cs | 128 +++++++ .../TypeFeaturingComparer.cs | 134 +++++++ .../AutoGenDtoComparers/UnioningComparer.cs | 132 +++++++ .../Core/AutoGenDtoComparers/UsageComparer.cs | 147 ++++++++ .../UseCaseDefinitionComparer.cs | 132 +++++++ .../UseCaseUsageComparer.cs | 152 ++++++++ .../VariantMembershipComparer.cs | 133 +++++++ .../VerificationCaseDefinitionComparer.cs | 132 +++++++ .../VerificationCaseUsageComparer.cs | 152 ++++++++ .../ViewDefinitionComparer.cs | 132 +++++++ .../ViewRenderingMembershipComparer.cs | 133 +++++++ .../AutoGenDtoComparers/ViewUsageComparer.cs | 152 ++++++++ .../ViewpointDefinitionComparer.cs | 132 +++++++ .../ViewpointUsageComparer.cs | 152 ++++++++ .../WhileLoopActionUsageComparer.cs | 152 ++++++++ .../DeSerializerTestFixture.cs | 12 +- .../JsonSerializeAndDeserializeTestFixture.cs | 96 +++++ .../SysML2.NET.Serializer.Json.Tests.csproj | 1 + .../Comparers/GuidComparerTestFixture.cs | 51 --- .../SerializerTestFixture.cs | 53 +-- ...L2.NET.Serializer.MessagePack.Tests.csproj | 4 - .../Helpers/DataFormatterResolver.cs | 16 +- 208 files changed, 28523 insertions(+), 85 deletions(-) create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/AnnotatingElementComparer.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/AssociationComparer.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/DependencyComparer.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/EnumerationDefinitionComparer.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/FeatureComparer.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/FeatureTypingComparer.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/FlowComparer.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/FramedConcernMembershipComparer.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/LiteralIntegerComparer.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/LiteralRationalComparer.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/MembershipComparer.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/MultiplicityRangeComparer.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/OwningMembershipComparer.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/ReferenceSubsettingComparer.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/RequirementUsageComparer.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/SelectExpressionComparer.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/SubclassificationComparer.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/TextualRepresentationComparer.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/UsageComparer.cs create mode 100644 SysML2.NET.CodeGenerator.Tests/Generators/UmlHandleBarsGenerators/UmlCoreDtoComparerGeneratorTestFixture.cs create mode 100644 SysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/UmlCoreDtoComparerGenerator.cs create mode 100644 SysML2.NET.CodeGenerator/Templates/Uml/core-dto-comparer-class-uml-template.hbs create mode 100644 SysML2.NET.CodeGenerator/Templates/Uml/core-dto-comparerprovider-uml-template.hbs create mode 100644 SysML2.NET.Extensions.Tests/Comparers/FloatingPointComparerTestFixture.cs create mode 100644 SysML2.NET.Extensions.Tests/Comparers/GuidComparerTestFixture.cs create mode 100644 SysML2.NET.Extensions.Tests/Comparers/GuidSequenceEqualityTestFixture.cs create mode 100644 SysML2.NET.Extensions.Tests/Comparers/StringSequenceEqualityTestFixture.cs create mode 100644 SysML2.NET.Extensions/Comparers/FloatingPointComparer.cs create mode 100644 SysML2.NET.Extensions/Comparers/GuidSequenceEquality.cs create mode 100644 SysML2.NET.Extensions/Comparers/StringSequenceEquality.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/AcceptActionUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ActionDefinitionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ActionUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ActorMembershipComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/AllocationDefinitionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/AllocationUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/AnalysisCaseDefinitionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/AnalysisCaseUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/AnnotatingElementComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/AnnotationComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/AssertConstraintUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/AssignmentActionUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/AssociationComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/AssociationStructureComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/AttributeDefinitionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/AttributeUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/BehaviorComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/BindingConnectorAsUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/BindingConnectorComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/BooleanExpressionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/CalculationDefinitionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/CalculationUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/CaseDefinitionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/CaseUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ClassComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ClassifierComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/CollectExpressionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/CommentComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ComparerProvider.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConcernDefinitionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConcernUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConjugatedPortDefinitionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConjugatedPortTypingComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConjugationComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConnectionDefinitionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConnectionUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConnectorComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConstraintDefinitionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConstraintUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConstructorExpressionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/CrossSubsettingComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/DataTypeComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/DecisionNodeComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/DefinitionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/DependencyComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/DifferencingComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/DisjoiningComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/DocumentationComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ElementFilterMembershipComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/EndFeatureMembershipComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/EnumerationDefinitionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/EnumerationUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/EventOccurrenceUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ExhibitStateUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ExpressionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureChainExpressionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureChainingComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureInvertingComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureMembershipComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureReferenceExpressionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureTypingComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureValueComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/FlowComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/FlowDefinitionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/FlowEndComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/FlowUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ForLoopActionUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ForkNodeComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/FramedConcernMembershipComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/FunctionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/IfActionUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/IncludeUseCaseUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/IndexExpressionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/InteractionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/InterfaceDefinitionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/InterfaceUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/IntersectingComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/InvariantComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/InvocationExpressionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ItemDefinitionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ItemUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/JoinNodeComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/LibraryPackageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/LiteralBooleanComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/LiteralExpressionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/LiteralInfinityComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/LiteralIntegerComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/LiteralRationalComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/LiteralStringComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/MembershipComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/MembershipExposeComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/MembershipImportComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/MergeNodeComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/MetaclassComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/MetadataAccessExpressionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/MetadataDefinitionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/MetadataFeatureComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/MetadataUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/MultiplicityComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/MultiplicityRangeComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/NamespaceComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/NamespaceExposeComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/NamespaceImportComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/NullExpressionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ObjectiveMembershipComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/OccurrenceDefinitionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/OccurrenceUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/OperatorExpressionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/OwningMembershipComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/PackageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ParameterMembershipComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/PartDefinitionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/PartUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/PayloadFeatureComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/PerformActionUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/PortConjugationComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/PortDefinitionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/PortUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/PredicateComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/RedefinitionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ReferenceSubsettingComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ReferenceUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/RenderingDefinitionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/RenderingUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/RequirementConstraintMembershipComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/RequirementDefinitionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/RequirementUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/RequirementVerificationMembershipComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ResultExpressionMembershipComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ReturnParameterMembershipComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/SatisfyRequirementUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/SelectExpressionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/SendActionUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/SpecializationComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/StakeholderMembershipComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/StateDefinitionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/StateSubactionMembershipComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/StateUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/StepComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/StructureComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/SubclassificationComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/SubjectMembershipComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/SubsettingComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/SuccessionAsUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/SuccessionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/SuccessionFlowComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/SuccessionFlowUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/TerminateActionUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/TextualRepresentationComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/TransitionFeatureMembershipComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/TransitionUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/TriggerInvocationExpressionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/TypeComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/TypeFeaturingComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/UnioningComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/UsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/UseCaseDefinitionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/UseCaseUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/VariantMembershipComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/VerificationCaseDefinitionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/VerificationCaseUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ViewDefinitionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ViewRenderingMembershipComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ViewUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ViewpointDefinitionComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/ViewpointUsageComparer.cs create mode 100644 SysML2.NET.Extensions/Core/AutoGenDtoComparers/WhileLoopActionUsageComparer.cs create mode 100644 SysML2.NET.Serializer.Json.Tests/JsonSerializeAndDeserializeTestFixture.cs delete mode 100644 SysML2.NET.Serializer.MessagePack.Tests/Comparers/GuidComparerTestFixture.cs diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/AnnotatingElementComparer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/AnnotatingElementComparer.cs new file mode 100644 index 000000000..eab4d38d8 --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/AnnotatingElementComparer.cs @@ -0,0 +1,124 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Root.Annotations; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class AnnotatingElementComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IAnnotatingElement x, IAnnotatingElement y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IAnnotatingElement obj) + { + return HashCode.Combine(typeof(IAnnotatingElement), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/AssociationComparer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/AssociationComparer.cs new file mode 100644 index 000000000..21a8b5bdf --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/AssociationComparer.cs @@ -0,0 +1,134 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Kernel.Associations; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class AssociationComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IAssociation x, IAssociation y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IAssociation obj) + { + return HashCode.Combine(typeof(IAssociation), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/DependencyComparer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/DependencyComparer.cs new file mode 100644 index 000000000..5964eb41b --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/DependencyComparer.cs @@ -0,0 +1,134 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Root.Dependencies; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class DependencyComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IDependency x, IDependency y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.Client, y.Client)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.Supplier, y.Supplier)) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IDependency obj) + { + return HashCode.Combine(typeof(IDependency), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/EnumerationDefinitionComparer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/EnumerationDefinitionComparer.cs new file mode 100644 index 000000000..6df61fd39 --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/EnumerationDefinitionComparer.cs @@ -0,0 +1,130 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.Enumerations; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class EnumerationDefinitionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IEnumerationDefinition x, IEnumerationDefinition y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IEnumerationDefinition obj) + { + return HashCode.Combine(typeof(IEnumerationDefinition), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/FeatureComparer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/FeatureComparer.cs new file mode 100644 index 000000000..9e147f764 --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/FeatureComparer.cs @@ -0,0 +1,147 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Core.Features; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class FeatureComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IFeature x, IFeature y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IFeature obj) + { + return HashCode.Combine(typeof(IFeature), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/FeatureTypingComparer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/FeatureTypingComparer.cs new file mode 100644 index 000000000..1ababd5e4 --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/FeatureTypingComparer.cs @@ -0,0 +1,134 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Core.Features; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class FeatureTypingComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IFeatureTyping x, IFeatureTyping y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Type != y.Type) return false; + + if (x.TypedFeature != y.TypedFeature) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IFeatureTyping obj) + { + return HashCode.Combine(typeof(IFeatureTyping), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/FlowComparer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/FlowComparer.cs new file mode 100644 index 000000000..273559e59 --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/FlowComparer.cs @@ -0,0 +1,153 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Interactions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class FlowComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IFlow x, IFlow y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IFlow obj) + { + return HashCode.Combine(typeof(IFlow), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/FramedConcernMembershipComparer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/FramedConcernMembershipComparer.cs new file mode 100644 index 000000000..17d8d9a1d --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/FramedConcernMembershipComparer.cs @@ -0,0 +1,136 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.Systems.Requirements; + using SysML2.NET.Core.DTO.Systems.Requirements; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class FramedConcernMembershipComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IFramedConcernMembership x, IFramedConcernMembership y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.Kind != y.Kind) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Visibility != y.Visibility) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IFramedConcernMembership obj) + { + return HashCode.Combine(typeof(IFramedConcernMembership), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/LiteralIntegerComparer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/LiteralIntegerComparer.cs new file mode 100644 index 000000000..3aca24a47 --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/LiteralIntegerComparer.cs @@ -0,0 +1,149 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class LiteralIntegerComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ILiteralInteger x, ILiteralInteger y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Value != y.Value) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ILiteralInteger obj) + { + return HashCode.Combine(typeof(ILiteralInteger), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/LiteralRationalComparer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/LiteralRationalComparer.cs new file mode 100644 index 000000000..03e258c17 --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/LiteralRationalComparer.cs @@ -0,0 +1,149 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class LiteralRationalComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ILiteralRational x, ILiteralRational y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (FloatingPointComparer.NearlyEqual(x.Value, y.Value, FloatingPointComparer.DefaultDoubleEpsilon)) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ILiteralRational obj) + { + return HashCode.Combine(typeof(ILiteralRational), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/MembershipComparer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/MembershipComparer.cs new file mode 100644 index 000000000..404836a4f --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/MembershipComparer.cs @@ -0,0 +1,139 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Root.Namespaces; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class MembershipComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IMembership x, IMembership y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.MemberElement != y.MemberElement) return false; + + if (!OrdinalStringComparer.Equals(x.MemberName, y.MemberName)) return false; + + if (!OrdinalStringComparer.Equals(x.MemberShortName, y.MemberShortName)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Visibility != y.Visibility) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IMembership obj) + { + return HashCode.Combine(typeof(IMembership), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/MultiplicityRangeComparer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/MultiplicityRangeComparer.cs new file mode 100644 index 000000000..d5acd64ea --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/MultiplicityRangeComparer.cs @@ -0,0 +1,147 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Multiplicities; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class MultiplicityRangeComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IMultiplicityRange x, IMultiplicityRange y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IMultiplicityRange obj) + { + return HashCode.Combine(typeof(IMultiplicityRange), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/OwningMembershipComparer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/OwningMembershipComparer.cs new file mode 100644 index 000000000..b17495240 --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/OwningMembershipComparer.cs @@ -0,0 +1,133 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Root.Namespaces; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class OwningMembershipComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IOwningMembership x, IOwningMembership y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Visibility != y.Visibility) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IOwningMembership obj) + { + return HashCode.Combine(typeof(IOwningMembership), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/ReferenceSubsettingComparer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/ReferenceSubsettingComparer.cs new file mode 100644 index 000000000..f7249b328 --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/ReferenceSubsettingComparer.cs @@ -0,0 +1,132 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Core.Features; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ReferenceSubsettingComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IReferenceSubsetting x, IReferenceSubsetting y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.ReferencedFeature != y.ReferencedFeature) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IReferenceSubsetting obj) + { + return HashCode.Combine(typeof(IReferenceSubsetting), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/RequirementUsageComparer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/RequirementUsageComparer.cs new file mode 100644 index 000000000..a62c7cc1f --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/RequirementUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Requirements; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class RequirementUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IRequirementUsage x, IRequirementUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + if (!OrdinalStringComparer.Equals(x.ReqId, y.ReqId)) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IRequirementUsage obj) + { + return HashCode.Combine(typeof(IRequirementUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/SelectExpressionComparer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/SelectExpressionComparer.cs new file mode 100644 index 000000000..06113c5d2 --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/SelectExpressionComparer.cs @@ -0,0 +1,149 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class SelectExpressionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ISelectExpression x, ISelectExpression y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!OrdinalStringComparer.Equals(x.Operator, y.Operator)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ISelectExpression obj) + { + return HashCode.Combine(typeof(ISelectExpression), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/SubclassificationComparer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/SubclassificationComparer.cs new file mode 100644 index 000000000..f4e341b15 --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/SubclassificationComparer.cs @@ -0,0 +1,134 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Core.Classifiers; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class SubclassificationComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ISubclassification x, ISubclassification y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Subclassifier != y.Subclassifier) return false; + + if (x.Superclassifier != y.Superclassifier) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ISubclassification obj) + { + return HashCode.Combine(typeof(ISubclassification), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/TextualRepresentationComparer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/TextualRepresentationComparer.cs new file mode 100644 index 000000000..1f256011b --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/TextualRepresentationComparer.cs @@ -0,0 +1,128 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Root.Annotations; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class TextualRepresentationComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ITextualRepresentation x, ITextualRepresentation y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.Body, y.Body)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!OrdinalStringComparer.Equals(x.Language, y.Language)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ITextualRepresentation obj) + { + return HashCode.Combine(typeof(ITextualRepresentation), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/UsageComparer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/UsageComparer.cs new file mode 100644 index 000000000..925f3ccfc --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/UsageComparer.cs @@ -0,0 +1,147 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Systems.DefinitionAndUsage; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class UsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IUsage x, IUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IUsage obj) + { + return HashCode.Combine(typeof(IUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Generators/UmlHandleBarsGenerators/UmlCoreDtoComparerGeneratorTestFixture.cs b/SysML2.NET.CodeGenerator.Tests/Generators/UmlHandleBarsGenerators/UmlCoreDtoComparerGeneratorTestFixture.cs new file mode 100644 index 000000000..03411d3e1 --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Generators/UmlHandleBarsGenerators/UmlCoreDtoComparerGeneratorTestFixture.cs @@ -0,0 +1,79 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.CodeGenerator.Tests.Generators.UmlHandleBarsGenerators +{ + using System.IO; + using System.Threading.Tasks; + + using NUnit.Framework; + + using SysML2.NET.CodeGenerator.Generators.UmlHandleBarsGenerators; + using SysML2.NET.CodeGenerator.Tests.Expected.Ecore.Core; + + [TestFixture] + public class UmlCoreDtoComparerGeneratorTestFixture + { + private DirectoryInfo umlDtoComparerDirectoryInfo; + private UmlCoreDtoComparerGenerator umlCoreDtoComparerGenerator; + + [OneTimeSetUp] + public void SetUp() + { + var directoryInfo = new DirectoryInfo(TestContext.CurrentContext.TestDirectory); + + var path = Path.Combine("UML", "_SysML2.NET.Core.Extensions.AutoGenDtoComparers"); + + this.umlDtoComparerDirectoryInfo = directoryInfo.CreateSubdirectory(path); + this.umlCoreDtoComparerGenerator = new UmlCoreDtoComparerGenerator(); + } + + [Test] + public async Task Verify_that_DataTransferObjectComparers_are_generated() + { + await Assert.ThatAsync(() => this.umlCoreDtoComparerGenerator.GenerateAsync(GeneratorSetupFixture.XmiReaderResult, + this.umlDtoComparerDirectoryInfo), + Throws.Nothing); + } + + [Test] + public async Task Verify_that_DataTransferObjectComparerProvider_is_generated() + { + await Assert.ThatAsync(() => this.umlCoreDtoComparerGenerator.GenerateDataTransferObjectComparerProviderAsync(GeneratorSetupFixture.XmiReaderResult, + this.umlDtoComparerDirectoryInfo), + Throws.Nothing); + } + + [Test] + [TestCaseSource(typeof(ExpectedConcreteClasses))] + [Category("Expected")] + public async Task Verify_that_expected_Classes_are_generated(string className) + { + var generatedCode = await this.umlCoreDtoComparerGenerator.GenerateDataTransferObjectComparerAsync(GeneratorSetupFixture.XmiReaderResult, + this.umlDtoComparerDirectoryInfo, + className); + + var expected = await File.ReadAllTextAsync(Path.Combine(TestContext.CurrentContext.TestDirectory, + $"Expected/UML/Core/AutoGenDtoComparers/{className}Comparer.cs")); + + Assert.That(generatedCode, Is.EqualTo(expected)); + } + } +} diff --git a/SysML2.NET.CodeGenerator.Tests/SysML2.NET.CodeGenerator.Tests.csproj b/SysML2.NET.CodeGenerator.Tests/SysML2.NET.CodeGenerator.Tests.csproj index 13417d2ba..9b3ee45aa 100644 --- a/SysML2.NET.CodeGenerator.Tests/SysML2.NET.CodeGenerator.Tests.csproj +++ b/SysML2.NET.CodeGenerator.Tests/SysML2.NET.CodeGenerator.Tests.csproj @@ -24,6 +24,25 @@ + + + + + + + + + + + + + + + + + + + @@ -75,6 +94,63 @@ + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + Always diff --git a/SysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/UmlCoreDtoComparerGenerator.cs b/SysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/UmlCoreDtoComparerGenerator.cs new file mode 100644 index 000000000..204d72175 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/UmlCoreDtoComparerGenerator.cs @@ -0,0 +1,229 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2025 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.CodeGenerator.Generators.UmlHandleBarsGenerators +{ + using System; + using System.IO; + using System.Linq; + using System.Threading.Tasks; + + using SysML2.NET.CodeGenerator.Extensions; + using SysML2.NET.CodeGenerator.UmlHandleBarHelpers; + + using uml4net.Extensions; + using uml4net.HandleBars; + using uml4net.StructuredClassifiers; + using uml4net.xmi.Readers; + + /// + /// A UML Handlebars based DTO comparer code generator + /// + public class UmlCoreDtoComparerGenerator : UmlHandleBarsGenerator + { + /// + /// Generates the SysML2 DTO comparers + /// + /// + /// the that contains the UML model to generate from + /// + /// + /// The target + /// + /// + /// an awaitable + /// + public override async Task GenerateAsync(XmiReaderResult xmiReaderResult, DirectoryInfo outputDirectory) + { + await this.GenerateDataTransferObjectComparersAsync(xmiReaderResult, outputDirectory); + await this.GenerateDataTransferObjectComparerProviderAsync(xmiReaderResult, outputDirectory); + } + + /// + /// Generates DTO Interfaces + /// + /// + /// the that contains the UML model to generate from + /// + /// + /// The target + /// + /// + /// an awaitable task + /// + public Task GenerateDataTransferObjectComparersAsync(XmiReaderResult xmiReaderResult, DirectoryInfo outputDirectory) + { + ArgumentNullException.ThrowIfNull(xmiReaderResult); + ArgumentNullException.ThrowIfNull(outputDirectory); + + return this.GenerateDataTransferObjectComparersInternalAsync(xmiReaderResult, outputDirectory); + } + + public Task GenerateDataTransferObjectComparerProviderAsync(XmiReaderResult xmiReaderResult, DirectoryInfo outputDirectory) + { + ArgumentNullException.ThrowIfNull(xmiReaderResult); + ArgumentNullException.ThrowIfNull(outputDirectory); + + return this.GenerateDataTransferObjectComparerProviderInternalAsync(xmiReaderResult, outputDirectory); + } + + /// + /// Generates DTO class + /// + /// + /// the that contains the UML model to generate from + /// + /// + /// The target + /// + /// + /// The name of the DTO class to generate + /// + /// + /// an awaitable task + /// + public Task GenerateDataTransferObjectComparerAsync(XmiReaderResult xmiReaderResult, DirectoryInfo outputDirectory, string name) + { + ArgumentNullException.ThrowIfNull(xmiReaderResult); + ArgumentNullException.ThrowIfNull(outputDirectory); + ArgumentException.ThrowIfNullOrWhiteSpace(name); + + return this.GenerateDataTransferObjectComparerInternalAsync(xmiReaderResult, outputDirectory, name); + } + + /// + /// Register the custom helpers + /// + protected override void RegisterHelpers() + { + this.Handlebars.RegisterStringHelper(); + this.Handlebars.RegisterEnumerableHelper(); + this.Handlebars.RegisterClassHelper(); + this.Handlebars.RegisterPropertyHelper(); + this.Handlebars.RegisterGeneralizationHelper(); + this.Handlebars.RegisterDocumentationHelper(); + this.Handlebars.RegisterEnumHelper(); + this.Handlebars.RegisterDecoratorHelper(); + this.Handlebars.RegisterNamedElementHelper(); + + EnumerationLiteralHelper.RegisterTypeNameHelper(this.Handlebars); + HandleBarHelpers.ClassHelper.RegisterClassHelper(this.Handlebars); + HandleBarHelpers.NamedElementHelper.RegisterNamedElementHelper(this.Handlebars); + HandleBarHelpers.PropertyHelper.RegisterPropertyHelper(this.Handlebars); + } + + /// + /// Register the code templates + /// + protected override void RegisterTemplates() + { + this.RegisterTemplate("core-dto-comparer-class-uml-template"); + this.RegisterTemplate("core-dto-comparerprovider-uml-template"); + } + + /// + /// Generates DTO classes + /// + /// + /// the that contains the UML model to generate from + /// + /// + /// The target + /// + /// + /// an awaitable task + /// + private async Task GenerateDataTransferObjectComparersInternalAsync(XmiReaderResult xmiReaderResult, DirectoryInfo outputDirectory) + { + var template = this.Templates["core-dto-comparer-class-uml-template"]; + + var classes = xmiReaderResult.QueryContainedAndImported("SysML") + .SelectMany(x => x.PackagedElement.OfType()) + .Where(x => !x.IsAbstract) + .ToList(); + + foreach (var @class in classes) + { + var generatedDto = template(@class); + + generatedDto = this.CodeCleanup(generatedDto); + + var fileName = $"{@class.Name.CapitalizeFirstLetter()}Comparer.cs"; + + await WriteAsync(generatedDto, outputDirectory, fileName); + } + } + + /// + /// Generates DTO classes + /// + /// + /// the that contains the UML model to generate from + /// + /// + /// The target + /// + /// + /// The name of the DTO class to generate + /// + /// + /// an awaitable task + /// + private async Task GenerateDataTransferObjectComparerInternalAsync(XmiReaderResult xmiReaderResult, DirectoryInfo outputDirectory, string name) + { + var template = this.Templates["core-dto-comparer-class-uml-template"]; + + var classes = xmiReaderResult.QueryContainedAndImported("SysML") + .SelectMany(x => x.PackagedElement.OfType()); + + var @class = classes.Single(x => x.Name == name); + + var generatedDataTransferObjectClass = template(@class); + + generatedDataTransferObjectClass = this.CodeCleanup(generatedDataTransferObjectClass); + + var fileName = $"{@class.Name.CapitalizeFirstLetter()}Comparer.cs"; + + await WriteAsync(generatedDataTransferObjectClass, outputDirectory, fileName); + + return generatedDataTransferObjectClass; + } + + private async Task GenerateDataTransferObjectComparerProviderInternalAsync(XmiReaderResult xmiReaderResult, DirectoryInfo outputDirectory) + { + var template = this.Templates["core-dto-comparerprovider-uml-template"]; + + var classes = xmiReaderResult.QueryContainedAndImported("SysML") + .SelectMany(x => x.PackagedElement.OfType()) + .Where(x => !x.IsAbstract) + .OrderBy(x => x.Name); + + var generatedDataTransferObjectComparerProvider = template(classes); + + generatedDataTransferObjectComparerProvider = template(classes); + + generatedDataTransferObjectComparerProvider = this.CodeCleanup(generatedDataTransferObjectComparerProvider); + + await WriteAsync(generatedDataTransferObjectComparerProvider, outputDirectory, "ComparerProvider.cs"); + + return generatedDataTransferObjectComparerProvider; + } + } +} diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/PropertyHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/PropertyHelper.cs index c525fef78..c94ed1372 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/PropertyHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/PropertyHelper.cs @@ -753,6 +753,102 @@ public static void RegisterPropertyHelper(this IHandlebars handlebars) writer.WriteSafeString(sb); }); + handlebars.RegisterHelper("Property.WriteForDTOComparer", (writer, _, parameters) => + { + if (parameters.Length != 2) + { + throw new HandlebarsException("{{#Property.WriteForDTOComparer}} helper must have exactly two arguments"); + } + + var property = (parameters[0] as IProperty)!; + var classContext = (parameters[1] as IClass)!; + + var sb = new StringBuilder(); + var propertyName = StringExtensions.CapitalizeFirstLetter(property.Name); + var isRedefinedPropertyInContext = property.TryQueryRedefinedByProperty(classContext, out var redefiningProperty); + + if (isRedefinedPropertyInContext) + { + throw new InvalidOperationException("Property.WriteForDTOComparer is invalid for redefined properties"); + } + + if (property.IsDerived || property.IsDerivedUnion) + { + throw new InvalidOperationException("Property.WriteForDTOComparer is invalid for derived or derivedunion properties"); + } + + if (property.Type is IDataType) + { + if (property.QueryIsString()) + { + if (property.QueryIsEnumerable()) + { + if (property.IsOrdered) + { + sb.AppendLine($"if (!StringSequenceEquality.OrderedEqual(x.{propertyName}, y.{propertyName})) return false;"); + } + else + { + sb.AppendLine($"if (!StringSequenceEquality.UnorderedEqual(x.{propertyName}, y.{propertyName})) return false;"); + } + } + else + { + sb.AppendLine($"if (!OrdinalStringComparer.Equals(x.{propertyName}, y.{propertyName})) return false;"); + } + } + else if (property.QueryIsDouble()) + { + if (property.QueryIsNullable()) + { + sb.AppendLine($"if (x.{propertyName}.HasValue != y.{propertyName}.HasValue) return false;"); + + sb.AppendLine($"if (x.{propertyName}.HasValue && FloatingPointComparer.NearlyEqual(x.{propertyName}, y.{propertyName}, FloatingPointComparer.DefaultDoubleEpsilon)) return false;"); + } + else + { + sb.AppendLine($"if (FloatingPointComparer.NearlyEqual(x.{propertyName}, y.{propertyName}, FloatingPointComparer.DefaultDoubleEpsilon)) return false;"); + } + + } + else if (property.QueryIsFloat()) + { + if (property.QueryIsNullable()) + { + sb.AppendLine($"if (x.{propertyName}.HasValue != y.{propertyName}.HasValue) return false;"); + + sb.AppendLine($"if (x.{propertyName}.HasValue && FloatingPointComparer.NearlyEqual(x.{propertyName}, y.{propertyName}, FloatingPointComparer.DefaultFloatEpsilon)) return false;"); + } + + sb.AppendLine($"if (FloatingPointComparer.NearlyEqual(x.{propertyName}, y.{propertyName}, FloatingPointComparer.DefaultDoubleEpsilon)) return false;"); + } + else + { + sb.AppendLine($"if (x.{propertyName} != y.{propertyName}) return false;"); + } + } + else + { + if (property.QueryIsEnumerable()) + { + if (property.IsOrdered) + { + sb.AppendLine($"if (!GuidSequenceEquality.OrderedEqual(x.{propertyName}, y.{propertyName})) return false;"); + } + else + { + sb.AppendLine($"if (!GuidSequenceEquality.UnorderedEqual(x.{propertyName}, y.{propertyName})) return false;"); + } + } + else + { + sb.AppendLine($"if (x.{propertyName} != y.{propertyName}) return false;"); + } + } + + writer.WriteSafeString(sb + Environment.NewLine); + }); + handlebars.RegisterHelper("Property.IsPropertyRedefinedInClass", (context, arguments) => { if (context.Value is not IProperty property) @@ -861,7 +957,7 @@ public static void RegisterPropertyHelper(this IHandlebars handlebars) writer.WriteSafeString($"{variableName}.{propertyName}"); } }); - + handlebars.RegisterHelper("Property.IsOfTypeBaseElement", (_, arguments) => { if (arguments.Single() is not IProperty property) diff --git a/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj b/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj index f7b14396b..6ae57eb58 100644 --- a/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj +++ b/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj @@ -118,6 +118,12 @@ Always + + Always + + + Always + Always diff --git a/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-comparer-class-uml-template.hbs b/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-comparer-class-uml-template.hbs new file mode 100644 index 000000000..f853ed37c --- /dev/null +++ b/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-comparer-class-uml-template.hbs @@ -0,0 +1,116 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + {{ #Class.WriteEnumerationNameSpaces this}} + using SysML2.NET.Core.DTO.{{ #NamedElement.WriteFullyQualifiedNameSpace this }}; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class {{this.Name}}Comparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(I{{this.Name}} x, I{{this.Name}} y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + {{ #each (Class.QueryAllNonDerivedProperties this) as | property | }} + {{#unless (Property.IsPropertyRedefinedInClass this ../)}} + {{ #Property.WriteForDTOComparer property ../ }} + {{/unless}} + {{/each}} + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(I{{this.Name}} obj) + { + return HashCode.Combine(typeof(I{{this.Name}}), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-comparerprovider-uml-template.hbs b/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-comparerprovider-uml-template.hbs new file mode 100644 index 000000000..8e4c670b6 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-comparerprovider-uml-template.hbs @@ -0,0 +1,169 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.Collections.Generic; + + using SysML2.NET.Common; + + /// + /// Provides runtime access to equality comparers for DTO types. + /// + public static class ComparerProvider + { + private static readonly IReadOnlyDictionary> Comparers = + new Dictionary> + { + {{#each this as | class |}} + { typeof(SysML2.NET.Core.DTO.{{ #NamedElement.WriteFullyQualifiedNameSpace class }}.{{ class.Name }}), new Adapter(new {{ class.Name }}Comparer()) }, + {{/each}} + }; + + /// + /// Resolves the equality comparer for the specified DTO runtime type. + /// + public static IEqualityComparer Resolve(Type dtoType) + { + if (dtoType == null) + { + throw new ArgumentNullException(nameof(dtoType)); + } + + if (!Comparers.TryGetValue(dtoType, out var comparer)) + { + throw new NotSupportedException($"No equality comparer generated for DTO type '{dtoType.FullName}'."); + } + + return comparer; + } + + /// + /// Resolves the equality comparer for the runtime type of the given DTO. + /// + public static IEqualityComparer Resolve(IData dto) + { + if (dto == null) + { + throw new ArgumentNullException(nameof(dto)); + } + + return Resolve(dto.GetType()); + } + + /// + /// Adapts a strongly-typed comparer to . + /// This adapter exists solely to bridge generic invariance in C#. + /// + private sealed class Adapter : IEqualityComparer + where T : class, IData + { + private readonly IEqualityComparer inner; + + /// + /// Initializes a new instance of the class + /// wrapping the specified strongly-typed comparer. + /// + /// + /// The generated equality comparer responsible for comparing instances + /// of . + /// + /// + /// Thrown when is null. + /// + public Adapter(IEqualityComparer inner) + { + this.inner = inner; + } + + /// + /// Determines whether the specified instances are + /// equal by delegating to the wrapped . + /// + /// + /// The first object to compare. + /// + /// + /// The second object to compare. + /// + /// + /// true if and are + /// considered equal according to the wrapped comparer; otherwise, + /// false. + /// + /// + /// + /// If both references are identical, the method returns true + /// immediately. If either reference is null, the method returns + /// false. + /// + /// + /// Both arguments are expected to be instances of + /// . This invariant is guaranteed by + /// , which resolves adapters strictly + /// by the runtime type of the DTO. + /// + /// + public bool Equals(IData x, IData y) + { + if (ReferenceEquals(x, y)) return true; + if (x is null || y is null) return false; + + return this.inner.Equals((T)x, (T)y); + } + + /// + /// Returns a hash code for the specified instance + /// by delegating to the wrapped . + /// + /// + /// The object for which a hash code is to be returned. + /// + /// + /// A hash code for , suitable for use in hash-based + /// collections when combined with the corresponding equality semantics. + /// + /// + /// + /// The hash code implementation is fully delegated to the wrapped + /// comparer and therefore remains consistent with its + /// semantics. + /// + /// + /// The adapter does not attempt to normalize or reinterpret the hash + /// code in any way. + /// + /// + public int GetHashCode(IData obj) + { + return this.inner.GetHashCode((T)obj); + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions.Tests/Comparers/FloatingPointComparerTestFixture.cs b/SysML2.NET.Extensions.Tests/Comparers/FloatingPointComparerTestFixture.cs new file mode 100644 index 000000000..525364fe7 --- /dev/null +++ b/SysML2.NET.Extensions.Tests/Comparers/FloatingPointComparerTestFixture.cs @@ -0,0 +1,201 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Tests.Comparers +{ + using NUnit.Framework; + + using SysML2.NET.Extensions.Comparers; + + [TestFixture] + public class FloatingPointComparerTestFixture + { + [Test] + public void NearlyEqual_Double_WhenValuesAreExactlyEqual_ReturnsTrue() + { + Assert.That(FloatingPointComparer.NearlyEqual(1.234, 1.234), Is.True); + } + + [Test] + public void NearlyEqual_Double_WhenValuesDifferWithinAbsoluteEpsilonNearZero_ReturnsTrue() + { + var epsilon = FloatingPointComparer.DefaultDoubleEpsilon; + + Assert.That(FloatingPointComparer.NearlyEqual(0.0, epsilon * 0.5, epsilon), Is.True); + Assert.That(FloatingPointComparer.NearlyEqual(0.0, -epsilon * 0.5, epsilon), Is.True); + } + + [Test] + public void NearlyEqual_Double_WhenValuesDifferMoreThanAbsoluteEpsilonNearZero_ReturnsFalse() + { + var epsilon = FloatingPointComparer.DefaultDoubleEpsilon; + + Assert.That(FloatingPointComparer.NearlyEqual(0.0, epsilon * 2.0, epsilon), Is.False); + Assert.That(FloatingPointComparer.NearlyEqual(0.0, -epsilon * 2.0, epsilon), Is.False); + } + + [Test] + public void NearlyEqual_Double_WhenValuesDifferWithinRelativeTolerance_ReturnsTrue() + { + // Ensure we are in the relative regime: epsilon*scale dominates epsilon. + // For left=1e9, right=1e9+0.5, scale≈2e9 => epsilon*scale≈2, so diff=0.5 should be true. + var epsilon = FloatingPointComparer.DefaultDoubleEpsilon; + + var left = 1_000_000_000d; + var right = left + 0.5d; + + Assert.That(FloatingPointComparer.NearlyEqual(left, right, epsilon), Is.True); + } + + [Test] + public void NearlyEqual_Double_WhenValuesDifferOutsideRelativeTolerance_ReturnsFalse() + { + // For left=1e9, scale≈2e9 => epsilon*scale≈2, so diff=3 should be false. + var epsilon = FloatingPointComparer.DefaultDoubleEpsilon; + + var left = 1_000_000_000d; + var right = left + 3d; + + Assert.That(FloatingPointComparer.NearlyEqual(left, right, epsilon), Is.False); + } + + [Test] + public void NearlyEqual_Double_WhenOneValueIsInfinityAndOtherIsSameInfinity_ReturnsTrue() + { + Assert.That(FloatingPointComparer.NearlyEqual(double.PositiveInfinity, double.PositiveInfinity), Is.True); + Assert.That(FloatingPointComparer.NearlyEqual(double.NegativeInfinity, double.NegativeInfinity), Is.True); + } + + [Test] + public void NearlyEqual_Double_WhenOneValueIsInfinityAndOtherIsFinite_ReturnsFalse() + { + Assert.That(FloatingPointComparer.NearlyEqual(double.PositiveInfinity, 1.0), Is.False); + Assert.That(FloatingPointComparer.NearlyEqual(double.NegativeInfinity, -1.0), Is.False); + } + + [Test] + public void NearlyEqual_Double_WhenEitherIsNaN_ReturnsFalse() + { + Assert.That(FloatingPointComparer.NearlyEqual(double.NaN, double.NaN), Is.False); + Assert.That(FloatingPointComparer.NearlyEqual(double.NaN, 0.0), Is.False); + Assert.That(FloatingPointComparer.NearlyEqual(0.0, double.NaN), Is.False); + } + + [Test] + public void NearlyEqual_Float_WhenValuesAreExactlyEqual_ReturnsTrue() + { + Assert.That(FloatingPointComparer.NearlyEqual(1.234f, 1.234f), Is.True); + } + + [Test] + public void NearlyEqual_Float_WhenValuesDifferWithinAbsoluteEpsilonNearZero_ReturnsTrue() + { + var epsilon = FloatingPointComparer.DefaultFloatEpsilon; + + Assert.That(FloatingPointComparer.NearlyEqual(0f, epsilon * 0.5f, epsilon), Is.True); + Assert.That(FloatingPointComparer.NearlyEqual(0f, -epsilon * 0.5f, epsilon), Is.True); + } + + [Test] + public void NearlyEqual_Float_WhenValuesDifferMoreThanAbsoluteEpsilonNearZero_ReturnsFalse() + { + var epsilon = FloatingPointComparer.DefaultFloatEpsilon; + + Assert.That(FloatingPointComparer.NearlyEqual(0f, epsilon * 2f, epsilon), Is.False); + Assert.That(FloatingPointComparer.NearlyEqual(0f, -epsilon * 2f, epsilon), Is.False); + } + + [Test] + public void NearlyEqual_Float_WhenValuesDifferWithinRelativeTolerance_ReturnsTrue() + { + // For left=1e6, scale≈2e6 => epsilon*scale≈2 (with epsilon=1e-6) so diff=0.5 should be true. + var epsilon = FloatingPointComparer.DefaultFloatEpsilon; + + var left = 1_000_000f; + var right = left + 0.5f; + + Assert.That(FloatingPointComparer.NearlyEqual(left, right, epsilon), Is.True); + } + + [Test] + public void NearlyEqual_Float_WhenValuesDifferOutsideRelativeTolerance_ReturnsFalse() + { + // For left=1e6, scale≈2e6 => epsilon*scale≈2 so diff=3 should be false. + var epsilon = FloatingPointComparer.DefaultFloatEpsilon; + + var left = 1_000_000f; + var right = left + 3f; + + Assert.That(FloatingPointComparer.NearlyEqual(left, right, epsilon), Is.False); + } + + [Test] + public void NearlyEqual_Float_WhenOneValueIsInfinityAndOtherIsSameInfinity_ReturnsTrue() + { + Assert.That(FloatingPointComparer.NearlyEqual(float.PositiveInfinity, float.PositiveInfinity), Is.True); + Assert.That(FloatingPointComparer.NearlyEqual(float.NegativeInfinity, float.NegativeInfinity), Is.True); + } + + [Test] + public void NearlyEqual_Float_WhenOneValueIsInfinityAndOtherIsFinite_ReturnsFalse() + { + Assert.That(FloatingPointComparer.NearlyEqual(float.PositiveInfinity, 1f), Is.False); + Assert.That(FloatingPointComparer.NearlyEqual(float.NegativeInfinity, -1f), Is.False); + } + + [Test] + public void NearlyEqual_Float_WhenEitherIsNaN_ReturnsFalse() + { + Assert.That(FloatingPointComparer.NearlyEqual(float.NaN, float.NaN), Is.False); + Assert.That(FloatingPointComparer.NearlyEqual(float.NaN, 0f), Is.False); + Assert.That(FloatingPointComparer.NearlyEqual(0f, float.NaN), Is.False); + } + + [Test] + public void NearlyEqual_UsesProvidedEpsilon() + { + // Make epsilon big on purpose so the comparison returns true. + const double epsilon = 1e-3; + + Assert.That(FloatingPointComparer.NearlyEqual(1.0, 1.0005, epsilon), Is.True); + + // And small so it returns false. + const double smallEpsilon = 1e-9; + + Assert.That(FloatingPointComparer.NearlyEqual(1.0, 1.0005, smallEpsilon), Is.False); + } + + [Test] + public void NearlyEqual_IsSymmetric_ForRepresentativeValues() + { + var epsilonD = FloatingPointComparer.DefaultDoubleEpsilon; + var aD = 1_000_000_000d; + var bD = aD + 0.5d; + + Assert.That(FloatingPointComparer.NearlyEqual(aD, bD, epsilonD), Is.EqualTo(FloatingPointComparer.NearlyEqual(bD, aD, epsilonD))); + + var epsilonF = FloatingPointComparer.DefaultFloatEpsilon; + var aF = 1_000_000f; + var bF = aF + 0.5f; + + Assert.That(FloatingPointComparer.NearlyEqual(aF, bF, epsilonF), Is.EqualTo(FloatingPointComparer.NearlyEqual(bF, aF, epsilonF))); + } + } +} diff --git a/SysML2.NET.Extensions.Tests/Comparers/GuidComparerTestFixture.cs b/SysML2.NET.Extensions.Tests/Comparers/GuidComparerTestFixture.cs new file mode 100644 index 000000000..e3de342c6 --- /dev/null +++ b/SysML2.NET.Extensions.Tests/Comparers/GuidComparerTestFixture.cs @@ -0,0 +1,129 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2025 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Tests.Comparers +{ + using System; + + using NUnit.Framework; + + using SysML2.NET.Extensions.Comparers; + + [TestFixture] + public class GuidComparerTestFixture + { + private GuidComparer comparer; + + [SetUp] + public void SetUp() + { + this.comparer = new GuidComparer(); + } + + [Test] + public void Verify_that_comparing_equal_guids_returns_zero() + { + var guid = Guid.NewGuid(); + + var result = this.comparer.Compare(guid, guid); + + Assert.That(result, Is.EqualTo(0)); + } + + [Test] + public void Verify_that_comparing_two_identical_guid_values_returns_zero() + { + var guid = Guid.NewGuid(); + var sameGuid = new Guid(guid.ToByteArray()); + + var result = this.comparer.Compare(guid, sameGuid); + + Assert.That(result, Is.EqualTo(0)); + } + + [Test] + public void Verify_that_comparing_a_smaller_guid_with_a_larger_guid_returns_a_negative_value() + { + var smaller = Guid.Parse("00000000-0000-0000-0000-000000000001"); + var larger = Guid.Parse("00000000-0000-0000-0000-000000000002"); + + var result = this.comparer.Compare(smaller, larger); + + Assert.That(result, Is.LessThan(0)); + } + + [Test] + public void Verify_that_comparing_a_larger_guid_with_a_smaller_guid_returns_a_positive_value() + { + var smaller = Guid.Parse("00000000-0000-0000-0000-000000000001"); + var larger = Guid.Parse("00000000-0000-0000-0000-000000000002"); + + var result = this.comparer.Compare(larger, smaller); + + Assert.That(result, Is.GreaterThan(0)); + } + + [Test] + public void Verify_that_guid_comparison_is_symmetric() + { + var guidA = Guid.NewGuid(); + var guidB = Guid.NewGuid(); + + var ab = this.comparer.Compare(guidA, guidB); + var ba = this.comparer.Compare(guidB, guidA); + + Assert.That(ab, Is.EqualTo(-ba)); + } + + [Test] + public void Verify_that_guid_comparison_is_consistent_across_multiple_calls() + { + var guidA = Guid.NewGuid(); + var guidB = Guid.NewGuid(); + + var first = this.comparer.Compare(guidA, guidB); + var second = this.comparer.Compare(guidA, guidB); + + Assert.That(first, Is.EqualTo(second)); + } + + [Test] + public void Verify_that_empty_guid_is_less_than_any_non_empty_guid() + { + var empty = Guid.Empty; + var nonEmpty = Guid.NewGuid(); + + var result = this.comparer.Compare(empty, nonEmpty); + + Assert.That(result, Is.LessThan(0)); + } + + [Test] + public void Verify_that_non_empty_guid_is_greater_than_empty_guid() + { + var empty = Guid.Empty; + var nonEmpty = Guid.NewGuid(); + + var result = this.comparer.Compare(nonEmpty, empty); + + Assert.That(result, Is.GreaterThan(0)); + } + } +} diff --git a/SysML2.NET.Extensions.Tests/Comparers/GuidSequenceEqualityTestFixture.cs b/SysML2.NET.Extensions.Tests/Comparers/GuidSequenceEqualityTestFixture.cs new file mode 100644 index 000000000..35cef47f5 --- /dev/null +++ b/SysML2.NET.Extensions.Tests/Comparers/GuidSequenceEqualityTestFixture.cs @@ -0,0 +1,182 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2025 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Tests.Comparers +{ + using System; + using System.Collections.Generic; + using NUnit.Framework; + using SysML2.NET.Extensions.Comparers; + + [TestFixture] + public class GuidSequenceEqualityTestFixture + { + [Test] + public void Verify_that_ordered_equal_returns_true_for_the_same_reference() + { + var list = new List { Guid.NewGuid(), Guid.NewGuid() }; + + Assert.That(GuidSequenceEquality.OrderedEqual(list, list), Is.True); + } + + [Test] + public void Verify_that_unordered_equal_returns_true_for_the_same_reference() + { + var list = new List { Guid.NewGuid(), Guid.NewGuid() }; + + Assert.That(GuidSequenceEquality.UnorderedEqual(list, list), Is.True); + } + + [Test] + public void Verify_that_ordered_equal_returns_false_when_one_sequence_is_null() + { + var list = new List { Guid.NewGuid() }; + + Assert.That(GuidSequenceEquality.OrderedEqual(list, null), Is.False); + Assert.That(GuidSequenceEquality.OrderedEqual(null, list), Is.False); + } + + [Test] + public void Verify_that_unordered_equal_returns_false_when_one_sequence_is_null() + { + var list = new List { Guid.NewGuid() }; + + Assert.That(GuidSequenceEquality.UnorderedEqual(list, null), Is.False); + Assert.That(GuidSequenceEquality.UnorderedEqual(null, list), Is.False); + } + + [Test] + public void Verify_that_ordered_equal_returns_true_for_sequences_with_same_elements_in_same_order() + { + var g1 = Guid.NewGuid(); + var g2 = Guid.NewGuid(); + + var a = new List { g1, g2 }; + var b = new List { g1, g2 }; + + Assert.That(GuidSequenceEquality.OrderedEqual(a, b), Is.True); + } + + [Test] + public void Verify_that_ordered_equal_returns_false_for_sequences_with_same_elements_in_different_order() + { + var g1 = Guid.NewGuid(); + var g2 = Guid.NewGuid(); + + var a = new List { g1, g2 }; + var b = new List { g2, g1 }; + + Assert.That(GuidSequenceEquality.OrderedEqual(a, b), Is.False); + } + + [Test] + public void Verify_that_unordered_equal_returns_true_for_sequences_with_same_elements_in_different_order() + { + var g1 = Guid.NewGuid(); + var g2 = Guid.NewGuid(); + + var a = new List { g1, g2 }; + var b = new List { g2, g1 }; + + Assert.That(GuidSequenceEquality.UnorderedEqual(a, b), Is.True); + } + + [Test] + public void Verify_that_ordered_equal_returns_false_for_sequences_with_different_lengths() + { + var g1 = Guid.NewGuid(); + + var a = new List { g1 }; + var b = new List { g1, Guid.NewGuid() }; + + Assert.That(GuidSequenceEquality.OrderedEqual(a, b), Is.False); + } + + [Test] + public void Verify_that_unordered_equal_returns_false_for_sequences_with_different_lengths() + { + var g1 = Guid.NewGuid(); + + var a = new List { g1 }; + var b = new List { g1, Guid.NewGuid() }; + + Assert.That(GuidSequenceEquality.UnorderedEqual(a, b), Is.False); + } + + [Test] + public void Verify_that_unordered_equal_correctly_handles_duplicate_guids() + { + var g1 = Guid.NewGuid(); + var g2 = Guid.NewGuid(); + + var a = new List { g1, g1, g2 }; + var b = new List { g2, g1, g1 }; + + Assert.That(GuidSequenceEquality.UnorderedEqual(a, b), Is.True); + } + + [Test] + public void Verify_that_unordered_equal_returns_false_when_duplicate_multiplicity_differs() + { + var g1 = Guid.NewGuid(); + + var a = new List { g1, g1 }; + var b = new List { g1 }; + + Assert.That(GuidSequenceEquality.UnorderedEqual(a, b), Is.False); + } + + [Test] + public void Verify_that_ordered_equal_returns_false_when_any_element_differs() + { + var a = new List { Guid.NewGuid(), Guid.NewGuid() }; + var b = new List { Guid.NewGuid(), Guid.NewGuid() }; + + Assert.That(GuidSequenceEquality.OrderedEqual(a, b), Is.False); + } + + [Test] + public void Verify_that_unordered_equal_returns_false_when_any_element_differs() + { + var a = new List { Guid.NewGuid(), Guid.NewGuid() }; + var b = new List { Guid.NewGuid(), Guid.NewGuid() }; + + Assert.That(GuidSequenceEquality.UnorderedEqual(a, b), Is.False); + } + + [Test] + public void Verify_that_empty_sequences_are_considered_equal_for_ordered_comparison() + { + var a = new List(); + var b = new List(); + + Assert.That(GuidSequenceEquality.OrderedEqual(a, b), Is.True); + } + + [Test] + public void Verify_that_empty_sequences_are_considered_equal_for_unordered_comparison() + { + var a = new List(); + var b = new List(); + + Assert.That(GuidSequenceEquality.UnorderedEqual(a, b), Is.True); + } + } +} diff --git a/SysML2.NET.Extensions.Tests/Comparers/StringSequenceEqualityTestFixture.cs b/SysML2.NET.Extensions.Tests/Comparers/StringSequenceEqualityTestFixture.cs new file mode 100644 index 000000000..9823d4288 --- /dev/null +++ b/SysML2.NET.Extensions.Tests/Comparers/StringSequenceEqualityTestFixture.cs @@ -0,0 +1,204 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2025 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Tests.Comparers +{ + using System; + using System.Collections.Generic; + + using NUnit.Framework; + + using SysML2.NET.Extensions.Comparers; + + + [TestFixture] + public class StringSequenceEqualityTestFixture + { + [Test] + public void Verify_that_ordered_equal_returns_true_for_the_same_reference() + { + var list = new List { "a", "b" }; + + Assert.That(StringSequenceEquality.OrderedEqual(list, list), Is.True); + } + + [Test] + public void Verify_that_unordered_equal_returns_true_for_the_same_reference() + { + var list = new List { "a", "b" }; + + Assert.That(StringSequenceEquality.UnorderedEqual(list, list), Is.True); + } + + [Test] + public void Verify_that_ordered_equal_returns_false_when_one_sequence_is_null() + { + var list = new List { "a" }; + + Assert.That(StringSequenceEquality.OrderedEqual(list, null), Is.False); + Assert.That(StringSequenceEquality.OrderedEqual(null, list), Is.False); + } + + [Test] + public void Verify_that_unordered_equal_returns_false_when_one_sequence_is_null() + { + var list = new List { "a" }; + + Assert.That(StringSequenceEquality.UnorderedEqual(list, null), Is.False); + Assert.That(StringSequenceEquality.UnorderedEqual(null, list), Is.False); + } + + [Test] + public void Verify_that_ordered_equal_returns_true_for_sequences_with_same_elements_in_same_order_using_default_ordinal_comparer() + { + var a = new List { "Alpha", "Beta" }; + var b = new List { "Alpha", "Beta" }; + + Assert.That(StringSequenceEquality.OrderedEqual(a, b), Is.True); + } + + [Test] + public void Verify_that_ordered_equal_returns_false_for_sequences_with_same_elements_in_different_order() + { + var a = new List { "Alpha", "Beta" }; + var b = new List { "Beta", "Alpha" }; + + Assert.That(StringSequenceEquality.OrderedEqual(a, b), Is.False); + } + + [Test] + public void Verify_that_unordered_equal_returns_true_for_sequences_with_same_elements_in_different_order() + { + var a = new List { "Alpha", "Beta" }; + var b = new List { "Beta", "Alpha" }; + + Assert.That(StringSequenceEquality.UnorderedEqual(a, b), Is.True); + } + + [Test] + public void Verify_that_ordered_equal_returns_false_for_sequences_with_different_lengths() + { + var a = new List { "Alpha" }; + var b = new List { "Alpha", "Beta" }; + + Assert.That(StringSequenceEquality.OrderedEqual(a, b), Is.False); + } + + [Test] + public void Verify_that_unordered_equal_returns_false_for_sequences_with_different_lengths() + { + var a = new List { "Alpha" }; + var b = new List { "Alpha", "Beta" }; + + Assert.That(StringSequenceEquality.UnorderedEqual(a, b), Is.False); + } + + [Test] + public void Verify_that_unordered_equal_correctly_handles_duplicate_values() + { + var a = new List { "Alpha", "Alpha", "Beta" }; + var b = new List { "Beta", "Alpha", "Alpha" }; + + Assert.That(StringSequenceEquality.UnorderedEqual(a, b), Is.True); + } + + [Test] + public void Verify_that_unordered_equal_returns_false_when_duplicate_multiplicity_differs() + { + var a = new List { "Alpha", "Alpha" }; + var b = new List { "Alpha", "Beta" }; + + Assert.That(StringSequenceEquality.UnorderedEqual(a, b), Is.False); + } + + [Test] + public void Verify_that_ordered_equal_returns_false_when_any_element_differs() + { + var a = new List { "Alpha", "Beta" }; + var b = new List { "Alpha", "Gamma" }; + + Assert.That(StringSequenceEquality.OrderedEqual(a, b), Is.False); + } + + [Test] + public void Verify_that_unordered_equal_returns_false_when_any_element_differs() + { + var a = new List { "Alpha", "Beta" }; + var b = new List { "Alpha", "Gamma" }; + + Assert.That(StringSequenceEquality.UnorderedEqual(a, b), Is.False); + } + + [Test] + public void Verify_that_empty_sequences_are_considered_equal_for_ordered_comparison() + { + var a = new List(); + var b = new List(); + + Assert.That(StringSequenceEquality.OrderedEqual(a, b), Is.True); + } + + [Test] + public void Verify_that_empty_sequences_are_considered_equal_for_unordered_comparison() + { + var a = new List(); + var b = new List(); + + Assert.That(StringSequenceEquality.UnorderedEqual(a, b), Is.True); + } + + [Test] + public void Verify_that_default_ordinal_comparison_is_case_sensitive() + { + var a = new List { "alpha" }; + var b = new List { "ALPHA" }; + + Assert.That(StringSequenceEquality.OrderedEqual(a, b), Is.False); + Assert.That(StringSequenceEquality.UnorderedEqual(a, b), Is.False); + } + + [Test] + public void Verify_that_a_custom_comparer_can_enable_case_insensitive_ordered_equality() + { + var a = new List { "alpha", "BETA" }; + var b = new List { "ALPHA", "beta" }; + + Assert.That(StringSequenceEquality.OrderedEqual(a, b, StringComparer.OrdinalIgnoreCase), Is.True); + } + + [Test] + public void Verify_that_a_custom_comparer_can_enable_case_insensitive_unordered_equality() + { + var a = new List { "alpha", "alpha", "BETA" }; + var b = new List { "beta", "ALPHA", "ALPHA" }; + + Assert.That(StringSequenceEquality.UnorderedEqual(a, b, StringComparer.OrdinalIgnoreCase), Is.True); + } + + [Test] + public void Verify_that_unordered_equal_returns_false_when_case_insensitive_comparer_is_not_used_and_casing_differs() + { + var a = new List { "alpha", "alpha", "BETA" }; + var b = new List { "beta", "ALPHA", "ALPHA" }; + + Assert.That(StringSequenceEquality.UnorderedEqual(a, b), Is.False); + } + } +} diff --git a/SysML2.NET.Extensions/Comparers/FloatingPointComparer.cs b/SysML2.NET.Extensions/Comparers/FloatingPointComparer.cs new file mode 100644 index 000000000..7d8eb739b --- /dev/null +++ b/SysML2.NET.Extensions/Comparers/FloatingPointComparer.cs @@ -0,0 +1,77 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Comparers +{ + using System; + + /// + /// Provides robust equality comparison helpers for floating-point values + /// using a combination of absolute and relative tolerance. + /// + public static class FloatingPointComparer + { + /// + /// Default epsilon for double-precision comparisons. + /// + public const double DefaultDoubleEpsilon = 1e-9; + + /// + /// Default epsilon for single-precision comparisons. + /// + public const float DefaultFloatEpsilon = 1e-6f; + + /// + /// Determines whether two values are nearly equal. + /// + public static bool NearlyEqual(double left, double right, double epsilon = DefaultDoubleEpsilon) + { + if (left == right) + { + return true; + } + + var difference = Math.Abs(left - right); + var scale = Math.Min( + Math.Abs(left) + Math.Abs(right), + double.MaxValue); + + return difference <= Math.Max(epsilon, epsilon * scale); + } + + /// + /// Determines whether two values are nearly equal. + /// + public static bool NearlyEqual(float left, float right, float epsilon = DefaultFloatEpsilon) + { + if (left == right) + { + return true; + } + + var difference = Math.Abs(left - right); + var scale = Math.Min( + Math.Abs(left) + Math.Abs(right), + float.MaxValue); + + return difference <= Math.Max(epsilon, epsilon * scale); + } + } +} diff --git a/SysML2.NET.Extensions/Comparers/GuidSequenceEquality.cs b/SysML2.NET.Extensions/Comparers/GuidSequenceEquality.cs new file mode 100644 index 000000000..cf8117dbc --- /dev/null +++ b/SysML2.NET.Extensions/Comparers/GuidSequenceEquality.cs @@ -0,0 +1,130 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Comparers +{ + using System; + using System.Collections.Generic; + + /// + /// Provides utility methods for comparing sequences of values + /// according to ordered and unordered equality semantics. + /// + public static class GuidSequenceEquality + { + /// + /// Determines whether two sequences of values are equal + /// using an ordered (positional) comparison. + /// + /// + /// The first sequence to compare. The order of elements is significant. + /// + /// + /// The second sequence to compare. The order of elements is significant. + /// + /// + /// true if both sequences contain the same number of elements and each + /// element in is equal to the corresponding element in + /// at the same position; otherwise, false. + /// + /// + /// This method performs a fast, allocation-free comparison and is suitable + /// for properties with isOrdered = true semantics in the metamodel. + /// + public static bool OrderedEqual(IReadOnlyList a, IReadOnlyList b) + { + if (ReferenceEquals(a, b)) return true; + if (a is null || b is null) return false; + + var count = a.Count; + if (count != b.Count) return false; + + for (var i = 0; i < count; i++) + { + if (a[i] != b[i]) return false; + } + + return true; + } + + /// + /// Determines whether two sequences of values are equal + /// regardless of element ordering. + /// + /// + /// The first sequence to compare. Element order is ignored. + /// + /// + /// The second sequence to compare. Element order is ignored. + /// + /// + /// true if both sequences contain the same elements with the same + /// multiplicities, independent of order; otherwise, false. + /// + /// + /// This method uses a hash-based comparison and correctly handles duplicate + /// values. It is suitable for properties with isOrdered = false + /// semantics in the metamodel. + /// + public static bool UnorderedEqual(IReadOnlyList a, IReadOnlyList b) + { + if (ReferenceEquals(a, b)) return true; + if (a is null || b is null) return false; + + var count = a.Count; + if (count != b.Count) return false; + + var counts = new Dictionary(count); + + for (var i = 0; i < count; i++) + { + var key = a[i]; + if (counts.TryGetValue(key, out var existing)) + { + counts[key] = existing + 1; + } + else + { + counts.Add(key, 1); + } + } + + for (var i = 0; i < count; i++) + { + var key = b[i]; + if (!counts.TryGetValue(key, out var existing)) + { + return false; + } + + if (existing == 1) + { + counts.Remove(key); + } + else + { + counts[key] = existing - 1; + } + } + + return counts.Count == 0; + } + } +} diff --git a/SysML2.NET.Extensions/Comparers/StringSequenceEquality.cs b/SysML2.NET.Extensions/Comparers/StringSequenceEquality.cs new file mode 100644 index 000000000..79394d13c --- /dev/null +++ b/SysML2.NET.Extensions/Comparers/StringSequenceEquality.cs @@ -0,0 +1,113 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2025 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Comparers +{ + using System; + using System.Collections.Generic; + + /// + /// Provides utility methods for comparing sequences of values + /// using ordered and unordered equality semantics. + /// + /// + /// All comparisons performed by this class use ordinal string semantics + /// by default (), ensuring deterministic, + /// culture-independent behavior suitable for identifiers, names, and other + /// model-level string values. + /// + public class StringSequenceEquality + { + /// + /// Determines whether two string sequences are equal using an ordered + /// (positional) comparison with ordinal semantics. + /// + public static bool OrderedEqual(IReadOnlyList a, IReadOnlyList b, StringComparer comparer = null) + { + comparer ??= StringComparer.Ordinal; + + if (ReferenceEquals(a, b)) return true; + if (a is null || b is null) return false; + + var count = a.Count; + if (count != b.Count) return false; + + for (var i = 0; i < count; i++) + { + if (!comparer.Equals(a[i], b[i])) + { + return false; + } + } + + return true; + } + + /// + /// Determines whether two string sequences are equal regardless of order, + /// using ordinal semantics. + /// + public static bool UnorderedEqual(IReadOnlyList a, IReadOnlyList b, StringComparer comparer = null) + { + comparer ??= StringComparer.Ordinal; + + if (ReferenceEquals(a, b)) return true; + if (a is null || b is null) return false; + + var count = a.Count; + if (count != b.Count) return false; + + var set = new Dictionary(count, comparer); + + for (var i = 0; i < count; i++) + { + var value = a[i]; + if (set.TryGetValue(value, out var current)) + { + set[value] = current + 1; + } + else + { + set[value] = 1; + } + } + + for (var i = 0; i < count; i++) + { + var value = b[i]; + if (!set.TryGetValue(value, out var current)) + { + return false; + } + + if (current == 1) + { + set.Remove(value); + } + else + { + set[value] = current - 1; + } + } + + return set.Count == 0; + } + } +} diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AcceptActionUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AcceptActionUsageComparer.cs new file mode 100644 index 000000000..ab72e1281 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AcceptActionUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Actions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class AcceptActionUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IAcceptActionUsage x, IAcceptActionUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IAcceptActionUsage obj) + { + return HashCode.Combine(typeof(IAcceptActionUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ActionDefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ActionDefinitionComparer.cs new file mode 100644 index 000000000..f0ac75e13 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ActionDefinitionComparer.cs @@ -0,0 +1,132 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.Actions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ActionDefinitionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IActionDefinition x, IActionDefinition y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IActionDefinition obj) + { + return HashCode.Combine(typeof(IActionDefinition), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ActionUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ActionUsageComparer.cs new file mode 100644 index 000000000..2ff6e020c --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ActionUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Actions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ActionUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IActionUsage x, IActionUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IActionUsage obj) + { + return HashCode.Combine(typeof(IActionUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ActorMembershipComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ActorMembershipComparer.cs new file mode 100644 index 000000000..248e487fd --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ActorMembershipComparer.cs @@ -0,0 +1,133 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Systems.Requirements; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ActorMembershipComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IActorMembership x, IActorMembership y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Visibility != y.Visibility) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IActorMembership obj) + { + return HashCode.Combine(typeof(IActorMembership), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AllocationDefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AllocationDefinitionComparer.cs new file mode 100644 index 000000000..78610f3de --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AllocationDefinitionComparer.cs @@ -0,0 +1,138 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.Allocations; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class AllocationDefinitionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IAllocationDefinition x, IAllocationDefinition y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IAllocationDefinition obj) + { + return HashCode.Combine(typeof(IAllocationDefinition), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AllocationUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AllocationUsageComparer.cs new file mode 100644 index 000000000..02bc7025d --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AllocationUsageComparer.cs @@ -0,0 +1,158 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Allocations; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class AllocationUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IAllocationUsage x, IAllocationUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IAllocationUsage obj) + { + return HashCode.Combine(typeof(IAllocationUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AnalysisCaseDefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AnalysisCaseDefinitionComparer.cs new file mode 100644 index 000000000..d51e8e9be --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AnalysisCaseDefinitionComparer.cs @@ -0,0 +1,132 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.AnalysisCases; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class AnalysisCaseDefinitionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IAnalysisCaseDefinition x, IAnalysisCaseDefinition y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IAnalysisCaseDefinition obj) + { + return HashCode.Combine(typeof(IAnalysisCaseDefinition), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AnalysisCaseUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AnalysisCaseUsageComparer.cs new file mode 100644 index 000000000..e5a331e49 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AnalysisCaseUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.AnalysisCases; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class AnalysisCaseUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IAnalysisCaseUsage x, IAnalysisCaseUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IAnalysisCaseUsage obj) + { + return HashCode.Combine(typeof(IAnalysisCaseUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AnnotatingElementComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AnnotatingElementComparer.cs new file mode 100644 index 000000000..eab4d38d8 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AnnotatingElementComparer.cs @@ -0,0 +1,124 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Root.Annotations; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class AnnotatingElementComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IAnnotatingElement x, IAnnotatingElement y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IAnnotatingElement obj) + { + return HashCode.Combine(typeof(IAnnotatingElement), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AnnotationComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AnnotationComparer.cs new file mode 100644 index 000000000..80d22db2f --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AnnotationComparer.cs @@ -0,0 +1,132 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Root.Annotations; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class AnnotationComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IAnnotation x, IAnnotation y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (x.AnnotatedElement != y.AnnotatedElement) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IAnnotation obj) + { + return HashCode.Combine(typeof(IAnnotation), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AssertConstraintUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AssertConstraintUsageComparer.cs new file mode 100644 index 000000000..dcd4814bf --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AssertConstraintUsageComparer.cs @@ -0,0 +1,154 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Constraints; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class AssertConstraintUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IAssertConstraintUsage x, IAssertConstraintUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsNegated != y.IsNegated) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IAssertConstraintUsage obj) + { + return HashCode.Combine(typeof(IAssertConstraintUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AssignmentActionUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AssignmentActionUsageComparer.cs new file mode 100644 index 000000000..6fa054f26 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AssignmentActionUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Actions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class AssignmentActionUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IAssignmentActionUsage x, IAssignmentActionUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IAssignmentActionUsage obj) + { + return HashCode.Combine(typeof(IAssignmentActionUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AssociationComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AssociationComparer.cs new file mode 100644 index 000000000..21a8b5bdf --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AssociationComparer.cs @@ -0,0 +1,134 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Kernel.Associations; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class AssociationComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IAssociation x, IAssociation y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IAssociation obj) + { + return HashCode.Combine(typeof(IAssociation), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AssociationStructureComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AssociationStructureComparer.cs new file mode 100644 index 000000000..f5ef44b25 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AssociationStructureComparer.cs @@ -0,0 +1,134 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Kernel.Associations; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class AssociationStructureComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IAssociationStructure x, IAssociationStructure y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IAssociationStructure obj) + { + return HashCode.Combine(typeof(IAssociationStructure), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AttributeDefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AttributeDefinitionComparer.cs new file mode 100644 index 000000000..6ffdb83c6 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AttributeDefinitionComparer.cs @@ -0,0 +1,130 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.Attributes; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class AttributeDefinitionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IAttributeDefinition x, IAttributeDefinition y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IAttributeDefinition obj) + { + return HashCode.Combine(typeof(IAttributeDefinition), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AttributeUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AttributeUsageComparer.cs new file mode 100644 index 000000000..421822dc7 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AttributeUsageComparer.cs @@ -0,0 +1,147 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Systems.Attributes; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class AttributeUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IAttributeUsage x, IAttributeUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IAttributeUsage obj) + { + return HashCode.Combine(typeof(IAttributeUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/BehaviorComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/BehaviorComparer.cs new file mode 100644 index 000000000..cca506d35 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/BehaviorComparer.cs @@ -0,0 +1,128 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Kernel.Behaviors; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class BehaviorComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IBehavior x, IBehavior y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IBehavior obj) + { + return HashCode.Combine(typeof(IBehavior), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/BindingConnectorAsUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/BindingConnectorAsUsageComparer.cs new file mode 100644 index 000000000..a0b14e92a --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/BindingConnectorAsUsageComparer.cs @@ -0,0 +1,153 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Systems.Connections; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class BindingConnectorAsUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IBindingConnectorAsUsage x, IBindingConnectorAsUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IBindingConnectorAsUsage obj) + { + return HashCode.Combine(typeof(IBindingConnectorAsUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/BindingConnectorComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/BindingConnectorComparer.cs new file mode 100644 index 000000000..971212f54 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/BindingConnectorComparer.cs @@ -0,0 +1,153 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Connectors; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class BindingConnectorComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IBindingConnector x, IBindingConnector y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IBindingConnector obj) + { + return HashCode.Combine(typeof(IBindingConnector), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/BooleanExpressionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/BooleanExpressionComparer.cs new file mode 100644 index 000000000..2056e1382 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/BooleanExpressionComparer.cs @@ -0,0 +1,147 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Functions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class BooleanExpressionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IBooleanExpression x, IBooleanExpression y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IBooleanExpression obj) + { + return HashCode.Combine(typeof(IBooleanExpression), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/CalculationDefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/CalculationDefinitionComparer.cs new file mode 100644 index 000000000..ca751035d --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/CalculationDefinitionComparer.cs @@ -0,0 +1,132 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.Calculations; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class CalculationDefinitionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ICalculationDefinition x, ICalculationDefinition y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ICalculationDefinition obj) + { + return HashCode.Combine(typeof(ICalculationDefinition), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/CalculationUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/CalculationUsageComparer.cs new file mode 100644 index 000000000..5894715fd --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/CalculationUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Calculations; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class CalculationUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ICalculationUsage x, ICalculationUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ICalculationUsage obj) + { + return HashCode.Combine(typeof(ICalculationUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/CaseDefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/CaseDefinitionComparer.cs new file mode 100644 index 000000000..2d20d8e5a --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/CaseDefinitionComparer.cs @@ -0,0 +1,132 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.Cases; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class CaseDefinitionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ICaseDefinition x, ICaseDefinition y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ICaseDefinition obj) + { + return HashCode.Combine(typeof(ICaseDefinition), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/CaseUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/CaseUsageComparer.cs new file mode 100644 index 000000000..b25da2b8d --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/CaseUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Cases; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class CaseUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ICaseUsage x, ICaseUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ICaseUsage obj) + { + return HashCode.Combine(typeof(ICaseUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ClassComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ClassComparer.cs new file mode 100644 index 000000000..6de09b78c --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ClassComparer.cs @@ -0,0 +1,128 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Kernel.Classes; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ClassComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IClass x, IClass y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IClass obj) + { + return HashCode.Combine(typeof(IClass), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ClassifierComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ClassifierComparer.cs new file mode 100644 index 000000000..25de7b397 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ClassifierComparer.cs @@ -0,0 +1,128 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Core.Classifiers; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ClassifierComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IClassifier x, IClassifier y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IClassifier obj) + { + return HashCode.Combine(typeof(IClassifier), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/CollectExpressionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/CollectExpressionComparer.cs new file mode 100644 index 000000000..39f244cd2 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/CollectExpressionComparer.cs @@ -0,0 +1,149 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class CollectExpressionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ICollectExpression x, ICollectExpression y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!OrdinalStringComparer.Equals(x.Operator, y.Operator)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ICollectExpression obj) + { + return HashCode.Combine(typeof(ICollectExpression), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/CommentComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/CommentComparer.cs new file mode 100644 index 000000000..2aa850d56 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/CommentComparer.cs @@ -0,0 +1,128 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Root.Annotations; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class CommentComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IComment x, IComment y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.Body, y.Body)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!OrdinalStringComparer.Equals(x.Locale, y.Locale)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IComment obj) + { + return HashCode.Combine(typeof(IComment), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ComparerProvider.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ComparerProvider.cs new file mode 100644 index 000000000..9427dfcfd --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ComparerProvider.cs @@ -0,0 +1,333 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.Collections.Generic; + + using SysML2.NET.Common; + + /// + /// Provides runtime access to equality comparers for DTO types. + /// + public static class ComparerProvider + { + private static readonly IReadOnlyDictionary> Comparers = + new Dictionary> + { + { typeof(SysML2.NET.Core.DTO.Systems.Actions.AcceptActionUsage), new Adapter(new AcceptActionUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Actions.ActionDefinition), new Adapter(new ActionDefinitionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Actions.ActionUsage), new Adapter(new ActionUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Requirements.ActorMembership), new Adapter(new ActorMembershipComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Allocations.AllocationDefinition), new Adapter(new AllocationDefinitionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Allocations.AllocationUsage), new Adapter(new AllocationUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.AnalysisCases.AnalysisCaseDefinition), new Adapter(new AnalysisCaseDefinitionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.AnalysisCases.AnalysisCaseUsage), new Adapter(new AnalysisCaseUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Root.Annotations.AnnotatingElement), new Adapter(new AnnotatingElementComparer()) }, + { typeof(SysML2.NET.Core.DTO.Root.Annotations.Annotation), new Adapter(new AnnotationComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Constraints.AssertConstraintUsage), new Adapter(new AssertConstraintUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Actions.AssignmentActionUsage), new Adapter(new AssignmentActionUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Associations.Association), new Adapter(new AssociationComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Associations.AssociationStructure), new Adapter(new AssociationStructureComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Attributes.AttributeDefinition), new Adapter(new AttributeDefinitionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Attributes.AttributeUsage), new Adapter(new AttributeUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Behaviors.Behavior), new Adapter(new BehaviorComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Connectors.BindingConnector), new Adapter(new BindingConnectorComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Connections.BindingConnectorAsUsage), new Adapter(new BindingConnectorAsUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Functions.BooleanExpression), new Adapter(new BooleanExpressionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Calculations.CalculationDefinition), new Adapter(new CalculationDefinitionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Calculations.CalculationUsage), new Adapter(new CalculationUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Cases.CaseDefinition), new Adapter(new CaseDefinitionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Cases.CaseUsage), new Adapter(new CaseUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Classes.Class), new Adapter(new ClassComparer()) }, + { typeof(SysML2.NET.Core.DTO.Core.Classifiers.Classifier), new Adapter(new ClassifierComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Expressions.CollectExpression), new Adapter(new CollectExpressionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Root.Annotations.Comment), new Adapter(new CommentComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Requirements.ConcernDefinition), new Adapter(new ConcernDefinitionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Requirements.ConcernUsage), new Adapter(new ConcernUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Ports.ConjugatedPortDefinition), new Adapter(new ConjugatedPortDefinitionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Ports.ConjugatedPortTyping), new Adapter(new ConjugatedPortTypingComparer()) }, + { typeof(SysML2.NET.Core.DTO.Core.Types.Conjugation), new Adapter(new ConjugationComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Connections.ConnectionDefinition), new Adapter(new ConnectionDefinitionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Connections.ConnectionUsage), new Adapter(new ConnectionUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Connectors.Connector), new Adapter(new ConnectorComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Constraints.ConstraintDefinition), new Adapter(new ConstraintDefinitionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Constraints.ConstraintUsage), new Adapter(new ConstraintUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Expressions.ConstructorExpression), new Adapter(new ConstructorExpressionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Core.Features.CrossSubsetting), new Adapter(new CrossSubsettingComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.DataTypes.DataType), new Adapter(new DataTypeComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Actions.DecisionNode), new Adapter(new DecisionNodeComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.Definition), new Adapter(new DefinitionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Root.Dependencies.Dependency), new Adapter(new DependencyComparer()) }, + { typeof(SysML2.NET.Core.DTO.Core.Types.Differencing), new Adapter(new DifferencingComparer()) }, + { typeof(SysML2.NET.Core.DTO.Core.Types.Disjoining), new Adapter(new DisjoiningComparer()) }, + { typeof(SysML2.NET.Core.DTO.Root.Annotations.Documentation), new Adapter(new DocumentationComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Packages.ElementFilterMembership), new Adapter(new ElementFilterMembershipComparer()) }, + { typeof(SysML2.NET.Core.DTO.Core.Features.EndFeatureMembership), new Adapter(new EndFeatureMembershipComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Enumerations.EnumerationDefinition), new Adapter(new EnumerationDefinitionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Enumerations.EnumerationUsage), new Adapter(new EnumerationUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Occurrences.EventOccurrenceUsage), new Adapter(new EventOccurrenceUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.States.ExhibitStateUsage), new Adapter(new ExhibitStateUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Functions.Expression), new Adapter(new ExpressionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Core.Features.Feature), new Adapter(new FeatureComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Expressions.FeatureChainExpression), new Adapter(new FeatureChainExpressionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Core.Features.FeatureChaining), new Adapter(new FeatureChainingComparer()) }, + { typeof(SysML2.NET.Core.DTO.Core.Features.FeatureInverting), new Adapter(new FeatureInvertingComparer()) }, + { typeof(SysML2.NET.Core.DTO.Core.Types.FeatureMembership), new Adapter(new FeatureMembershipComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Expressions.FeatureReferenceExpression), new Adapter(new FeatureReferenceExpressionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Core.Features.FeatureTyping), new Adapter(new FeatureTypingComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.FeatureValues.FeatureValue), new Adapter(new FeatureValueComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Interactions.Flow), new Adapter(new FlowComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Flows.FlowDefinition), new Adapter(new FlowDefinitionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Interactions.FlowEnd), new Adapter(new FlowEndComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Flows.FlowUsage), new Adapter(new FlowUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Actions.ForkNode), new Adapter(new ForkNodeComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Actions.ForLoopActionUsage), new Adapter(new ForLoopActionUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Requirements.FramedConcernMembership), new Adapter(new FramedConcernMembershipComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Functions.Function), new Adapter(new FunctionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Actions.IfActionUsage), new Adapter(new IfActionUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.UseCases.IncludeUseCaseUsage), new Adapter(new IncludeUseCaseUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Expressions.IndexExpression), new Adapter(new IndexExpressionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Interactions.Interaction), new Adapter(new InteractionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Interfaces.InterfaceDefinition), new Adapter(new InterfaceDefinitionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Interfaces.InterfaceUsage), new Adapter(new InterfaceUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Core.Types.Intersecting), new Adapter(new IntersectingComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Functions.Invariant), new Adapter(new InvariantComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Expressions.InvocationExpression), new Adapter(new InvocationExpressionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Items.ItemDefinition), new Adapter(new ItemDefinitionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Items.ItemUsage), new Adapter(new ItemUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Actions.JoinNode), new Adapter(new JoinNodeComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Packages.LibraryPackage), new Adapter(new LibraryPackageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralBoolean), new Adapter(new LiteralBooleanComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralExpression), new Adapter(new LiteralExpressionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralInfinity), new Adapter(new LiteralInfinityComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralInteger), new Adapter(new LiteralIntegerComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralRational), new Adapter(new LiteralRationalComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralString), new Adapter(new LiteralStringComparer()) }, + { typeof(SysML2.NET.Core.DTO.Root.Namespaces.Membership), new Adapter(new MembershipComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Views.MembershipExpose), new Adapter(new MembershipExposeComparer()) }, + { typeof(SysML2.NET.Core.DTO.Root.Namespaces.MembershipImport), new Adapter(new MembershipImportComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Actions.MergeNode), new Adapter(new MergeNodeComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Metadata.Metaclass), new Adapter(new MetaclassComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Expressions.MetadataAccessExpression), new Adapter(new MetadataAccessExpressionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Metadata.MetadataDefinition), new Adapter(new MetadataDefinitionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Metadata.MetadataFeature), new Adapter(new MetadataFeatureComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Metadata.MetadataUsage), new Adapter(new MetadataUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Core.Types.Multiplicity), new Adapter(new MultiplicityComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Multiplicities.MultiplicityRange), new Adapter(new MultiplicityRangeComparer()) }, + { typeof(SysML2.NET.Core.DTO.Root.Namespaces.Namespace), new Adapter(new NamespaceComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Views.NamespaceExpose), new Adapter(new NamespaceExposeComparer()) }, + { typeof(SysML2.NET.Core.DTO.Root.Namespaces.NamespaceImport), new Adapter(new NamespaceImportComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Expressions.NullExpression), new Adapter(new NullExpressionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Cases.ObjectiveMembership), new Adapter(new ObjectiveMembershipComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Occurrences.OccurrenceDefinition), new Adapter(new OccurrenceDefinitionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Occurrences.OccurrenceUsage), new Adapter(new OccurrenceUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Expressions.OperatorExpression), new Adapter(new OperatorExpressionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Root.Namespaces.OwningMembership), new Adapter(new OwningMembershipComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Packages.Package), new Adapter(new PackageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Behaviors.ParameterMembership), new Adapter(new ParameterMembershipComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Parts.PartDefinition), new Adapter(new PartDefinitionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Parts.PartUsage), new Adapter(new PartUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Interactions.PayloadFeature), new Adapter(new PayloadFeatureComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Actions.PerformActionUsage), new Adapter(new PerformActionUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Ports.PortConjugation), new Adapter(new PortConjugationComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Ports.PortDefinition), new Adapter(new PortDefinitionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Ports.PortUsage), new Adapter(new PortUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Functions.Predicate), new Adapter(new PredicateComparer()) }, + { typeof(SysML2.NET.Core.DTO.Core.Features.Redefinition), new Adapter(new RedefinitionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Core.Features.ReferenceSubsetting), new Adapter(new ReferenceSubsettingComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.ReferenceUsage), new Adapter(new ReferenceUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Views.RenderingDefinition), new Adapter(new RenderingDefinitionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Views.RenderingUsage), new Adapter(new RenderingUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Requirements.RequirementConstraintMembership), new Adapter(new RequirementConstraintMembershipComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Requirements.RequirementDefinition), new Adapter(new RequirementDefinitionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Requirements.RequirementUsage), new Adapter(new RequirementUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.VerificationCases.RequirementVerificationMembership), new Adapter(new RequirementVerificationMembershipComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Functions.ResultExpressionMembership), new Adapter(new ResultExpressionMembershipComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Functions.ReturnParameterMembership), new Adapter(new ReturnParameterMembershipComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Requirements.SatisfyRequirementUsage), new Adapter(new SatisfyRequirementUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Expressions.SelectExpression), new Adapter(new SelectExpressionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Actions.SendActionUsage), new Adapter(new SendActionUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Core.Types.Specialization), new Adapter(new SpecializationComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Requirements.StakeholderMembership), new Adapter(new StakeholderMembershipComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.States.StateDefinition), new Adapter(new StateDefinitionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.States.StateSubactionMembership), new Adapter(new StateSubactionMembershipComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.States.StateUsage), new Adapter(new StateUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Behaviors.Step), new Adapter(new StepComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Structures.Structure), new Adapter(new StructureComparer()) }, + { typeof(SysML2.NET.Core.DTO.Core.Classifiers.Subclassification), new Adapter(new SubclassificationComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Requirements.SubjectMembership), new Adapter(new SubjectMembershipComparer()) }, + { typeof(SysML2.NET.Core.DTO.Core.Features.Subsetting), new Adapter(new SubsettingComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Connectors.Succession), new Adapter(new SuccessionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Connections.SuccessionAsUsage), new Adapter(new SuccessionAsUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Kernel.Interactions.SuccessionFlow), new Adapter(new SuccessionFlowComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Flows.SuccessionFlowUsage), new Adapter(new SuccessionFlowUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Actions.TerminateActionUsage), new Adapter(new TerminateActionUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Root.Annotations.TextualRepresentation), new Adapter(new TextualRepresentationComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.States.TransitionFeatureMembership), new Adapter(new TransitionFeatureMembershipComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.States.TransitionUsage), new Adapter(new TransitionUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Actions.TriggerInvocationExpression), new Adapter(new TriggerInvocationExpressionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Core.Types.Type), new Adapter(new TypeComparer()) }, + { typeof(SysML2.NET.Core.DTO.Core.Features.TypeFeaturing), new Adapter(new TypeFeaturingComparer()) }, + { typeof(SysML2.NET.Core.DTO.Core.Types.Unioning), new Adapter(new UnioningComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.Usage), new Adapter(new UsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.UseCases.UseCaseDefinition), new Adapter(new UseCaseDefinitionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.UseCases.UseCaseUsage), new Adapter(new UseCaseUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.VariantMembership), new Adapter(new VariantMembershipComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.VerificationCases.VerificationCaseDefinition), new Adapter(new VerificationCaseDefinitionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.VerificationCases.VerificationCaseUsage), new Adapter(new VerificationCaseUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Views.ViewDefinition), new Adapter(new ViewDefinitionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Views.ViewpointDefinition), new Adapter(new ViewpointDefinitionComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Views.ViewpointUsage), new Adapter(new ViewpointUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Views.ViewRenderingMembership), new Adapter(new ViewRenderingMembershipComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Views.ViewUsage), new Adapter(new ViewUsageComparer()) }, + { typeof(SysML2.NET.Core.DTO.Systems.Actions.WhileLoopActionUsage), new Adapter(new WhileLoopActionUsageComparer()) }, + }; + + /// + /// Resolves the equality comparer for the specified DTO runtime type. + /// + public static IEqualityComparer Resolve(Type dtoType) + { + if (dtoType == null) + { + throw new ArgumentNullException(nameof(dtoType)); + } + + if (!Comparers.TryGetValue(dtoType, out var comparer)) + { + throw new NotSupportedException($"No equality comparer generated for DTO type '{dtoType.FullName}'."); + } + + return comparer; + } + + /// + /// Resolves the equality comparer for the runtime type of the given DTO. + /// + public static IEqualityComparer Resolve(IData dto) + { + if (dto == null) + { + throw new ArgumentNullException(nameof(dto)); + } + + return Resolve(dto.GetType()); + } + + /// + /// Adapts a strongly-typed comparer to . + /// This adapter exists solely to bridge generic invariance in C#. + /// + private sealed class Adapter : IEqualityComparer + where T : class, IData + { + private readonly IEqualityComparer inner; + + /// + /// Initializes a new instance of the class + /// wrapping the specified strongly-typed comparer. + /// + /// + /// The generated equality comparer responsible for comparing instances + /// of . + /// + /// + /// Thrown when is null. + /// + public Adapter(IEqualityComparer inner) + { + this.inner = inner; + } + + /// + /// Determines whether the specified instances are + /// equal by delegating to the wrapped . + /// + /// + /// The first object to compare. + /// + /// + /// The second object to compare. + /// + /// + /// true if and are + /// considered equal according to the wrapped comparer; otherwise, + /// false. + /// + /// + /// + /// If both references are identical, the method returns true + /// immediately. If either reference is null, the method returns + /// false. + /// + /// + /// Both arguments are expected to be instances of + /// . This invariant is guaranteed by + /// , which resolves adapters strictly + /// by the runtime type of the DTO. + /// + /// + public bool Equals(IData x, IData y) + { + if (ReferenceEquals(x, y)) return true; + if (x is null || y is null) return false; + + return this.inner.Equals((T)x, (T)y); + } + + /// + /// Returns a hash code for the specified instance + /// by delegating to the wrapped . + /// + /// + /// The object for which a hash code is to be returned. + /// + /// + /// A hash code for , suitable for use in hash-based + /// collections when combined with the corresponding equality semantics. + /// + /// + /// + /// The hash code implementation is fully delegated to the wrapped + /// comparer and therefore remains consistent with its + /// semantics. + /// + /// + /// The adapter does not attempt to normalize or reinterpret the hash + /// code in any way. + /// + /// + public int GetHashCode(IData obj) + { + return this.inner.GetHashCode((T)obj); + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConcernDefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConcernDefinitionComparer.cs new file mode 100644 index 000000000..3a5928b3f --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConcernDefinitionComparer.cs @@ -0,0 +1,132 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.Requirements; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ConcernDefinitionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IConcernDefinition x, IConcernDefinition y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (!OrdinalStringComparer.Equals(x.ReqId, y.ReqId)) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IConcernDefinition obj) + { + return HashCode.Combine(typeof(IConcernDefinition), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConcernUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConcernUsageComparer.cs new file mode 100644 index 000000000..9f3568165 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConcernUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Requirements; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ConcernUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IConcernUsage x, IConcernUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + if (!OrdinalStringComparer.Equals(x.ReqId, y.ReqId)) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IConcernUsage obj) + { + return HashCode.Combine(typeof(IConcernUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConjugatedPortDefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConjugatedPortDefinitionComparer.cs new file mode 100644 index 000000000..3e6e50e05 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConjugatedPortDefinitionComparer.cs @@ -0,0 +1,132 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.Ports; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ConjugatedPortDefinitionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IConjugatedPortDefinition x, IConjugatedPortDefinition y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IConjugatedPortDefinition obj) + { + return HashCode.Combine(typeof(IConjugatedPortDefinition), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConjugatedPortTypingComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConjugatedPortTypingComparer.cs new file mode 100644 index 000000000..7ff27c67a --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConjugatedPortTypingComparer.cs @@ -0,0 +1,134 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.Ports; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ConjugatedPortTypingComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IConjugatedPortTyping x, IConjugatedPortTyping y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (x.ConjugatedPortDefinition != y.ConjugatedPortDefinition) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.TypedFeature != y.TypedFeature) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IConjugatedPortTyping obj) + { + return HashCode.Combine(typeof(IConjugatedPortTyping), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConjugationComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConjugationComparer.cs new file mode 100644 index 000000000..1044f6599 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConjugationComparer.cs @@ -0,0 +1,134 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Core.Types; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ConjugationComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IConjugation x, IConjugation y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (x.ConjugatedType != y.ConjugatedType) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.OriginalType != y.OriginalType) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IConjugation obj) + { + return HashCode.Combine(typeof(IConjugation), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConnectionDefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConnectionDefinitionComparer.cs new file mode 100644 index 000000000..9fb0a6229 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConnectionDefinitionComparer.cs @@ -0,0 +1,138 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.Connections; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ConnectionDefinitionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IConnectionDefinition x, IConnectionDefinition y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IConnectionDefinition obj) + { + return HashCode.Combine(typeof(IConnectionDefinition), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConnectionUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConnectionUsageComparer.cs new file mode 100644 index 000000000..e6f264c4b --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConnectionUsageComparer.cs @@ -0,0 +1,158 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Connections; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ConnectionUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IConnectionUsage x, IConnectionUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IConnectionUsage obj) + { + return HashCode.Combine(typeof(IConnectionUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConnectorComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConnectorComparer.cs new file mode 100644 index 000000000..167b967bd --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConnectorComparer.cs @@ -0,0 +1,153 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Connectors; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ConnectorComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IConnector x, IConnector y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IConnector obj) + { + return HashCode.Combine(typeof(IConnector), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConstraintDefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConstraintDefinitionComparer.cs new file mode 100644 index 000000000..43f605427 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConstraintDefinitionComparer.cs @@ -0,0 +1,132 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.Constraints; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ConstraintDefinitionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IConstraintDefinition x, IConstraintDefinition y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IConstraintDefinition obj) + { + return HashCode.Combine(typeof(IConstraintDefinition), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConstraintUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConstraintUsageComparer.cs new file mode 100644 index 000000000..acd160699 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConstraintUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Constraints; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ConstraintUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IConstraintUsage x, IConstraintUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IConstraintUsage obj) + { + return HashCode.Combine(typeof(IConstraintUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConstructorExpressionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConstructorExpressionComparer.cs new file mode 100644 index 000000000..e52621675 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConstructorExpressionComparer.cs @@ -0,0 +1,147 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ConstructorExpressionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IConstructorExpression x, IConstructorExpression y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IConstructorExpression obj) + { + return HashCode.Combine(typeof(IConstructorExpression), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/CrossSubsettingComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/CrossSubsettingComparer.cs new file mode 100644 index 000000000..68727c7d2 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/CrossSubsettingComparer.cs @@ -0,0 +1,132 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Core.Features; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class CrossSubsettingComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ICrossSubsetting x, ICrossSubsetting y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (x.CrossedFeature != y.CrossedFeature) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ICrossSubsetting obj) + { + return HashCode.Combine(typeof(ICrossSubsetting), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DataTypeComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DataTypeComparer.cs new file mode 100644 index 000000000..8d2326434 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DataTypeComparer.cs @@ -0,0 +1,128 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Kernel.DataTypes; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class DataTypeComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IDataType x, IDataType y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IDataType obj) + { + return HashCode.Combine(typeof(IDataType), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DecisionNodeComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DecisionNodeComparer.cs new file mode 100644 index 000000000..9d15648ed --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DecisionNodeComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Actions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class DecisionNodeComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IDecisionNode x, IDecisionNode y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IDecisionNode obj) + { + return HashCode.Combine(typeof(IDecisionNode), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DefinitionComparer.cs new file mode 100644 index 000000000..f85fcf9ef --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DefinitionComparer.cs @@ -0,0 +1,130 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.DefinitionAndUsage; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class DefinitionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IDefinition x, IDefinition y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IDefinition obj) + { + return HashCode.Combine(typeof(IDefinition), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DependencyComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DependencyComparer.cs new file mode 100644 index 000000000..5964eb41b --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DependencyComparer.cs @@ -0,0 +1,134 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Root.Dependencies; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class DependencyComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IDependency x, IDependency y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.Client, y.Client)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.Supplier, y.Supplier)) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IDependency obj) + { + return HashCode.Combine(typeof(IDependency), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DifferencingComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DifferencingComparer.cs new file mode 100644 index 000000000..b017062b5 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DifferencingComparer.cs @@ -0,0 +1,132 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Core.Types; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class DifferencingComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IDifferencing x, IDifferencing y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.DifferencingType != y.DifferencingType) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IDifferencing obj) + { + return HashCode.Combine(typeof(IDifferencing), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DisjoiningComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DisjoiningComparer.cs new file mode 100644 index 000000000..133b08bd0 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DisjoiningComparer.cs @@ -0,0 +1,134 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Core.Types; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class DisjoiningComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IDisjoining x, IDisjoining y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.DisjoiningType != y.DisjoiningType) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.TypeDisjoined != y.TypeDisjoined) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IDisjoining obj) + { + return HashCode.Combine(typeof(IDisjoining), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DocumentationComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DocumentationComparer.cs new file mode 100644 index 000000000..d6bffcb50 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DocumentationComparer.cs @@ -0,0 +1,128 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Root.Annotations; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class DocumentationComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IDocumentation x, IDocumentation y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.Body, y.Body)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!OrdinalStringComparer.Equals(x.Locale, y.Locale)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IDocumentation obj) + { + return HashCode.Combine(typeof(IDocumentation), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ElementFilterMembershipComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ElementFilterMembershipComparer.cs new file mode 100644 index 000000000..bdfd6dd70 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ElementFilterMembershipComparer.cs @@ -0,0 +1,133 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Kernel.Packages; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ElementFilterMembershipComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IElementFilterMembership x, IElementFilterMembership y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Visibility != y.Visibility) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IElementFilterMembership obj) + { + return HashCode.Combine(typeof(IElementFilterMembership), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/EndFeatureMembershipComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/EndFeatureMembershipComparer.cs new file mode 100644 index 000000000..df9f95156 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/EndFeatureMembershipComparer.cs @@ -0,0 +1,133 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Core.Features; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class EndFeatureMembershipComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IEndFeatureMembership x, IEndFeatureMembership y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Visibility != y.Visibility) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IEndFeatureMembership obj) + { + return HashCode.Combine(typeof(IEndFeatureMembership), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/EnumerationDefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/EnumerationDefinitionComparer.cs new file mode 100644 index 000000000..6df61fd39 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/EnumerationDefinitionComparer.cs @@ -0,0 +1,130 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.Enumerations; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class EnumerationDefinitionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IEnumerationDefinition x, IEnumerationDefinition y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IEnumerationDefinition obj) + { + return HashCode.Combine(typeof(IEnumerationDefinition), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/EnumerationUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/EnumerationUsageComparer.cs new file mode 100644 index 000000000..1de1fdf9a --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/EnumerationUsageComparer.cs @@ -0,0 +1,147 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Systems.Enumerations; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class EnumerationUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IEnumerationUsage x, IEnumerationUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IEnumerationUsage obj) + { + return HashCode.Combine(typeof(IEnumerationUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/EventOccurrenceUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/EventOccurrenceUsageComparer.cs new file mode 100644 index 000000000..918d688ab --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/EventOccurrenceUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Occurrences; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class EventOccurrenceUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IEventOccurrenceUsage x, IEventOccurrenceUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IEventOccurrenceUsage obj) + { + return HashCode.Combine(typeof(IEventOccurrenceUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ExhibitStateUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ExhibitStateUsageComparer.cs new file mode 100644 index 000000000..c7af48bbe --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ExhibitStateUsageComparer.cs @@ -0,0 +1,154 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.States; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ExhibitStateUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IExhibitStateUsage x, IExhibitStateUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsParallel != y.IsParallel) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IExhibitStateUsage obj) + { + return HashCode.Combine(typeof(IExhibitStateUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ExpressionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ExpressionComparer.cs new file mode 100644 index 000000000..176455147 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ExpressionComparer.cs @@ -0,0 +1,147 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Functions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ExpressionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IExpression x, IExpression y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IExpression obj) + { + return HashCode.Combine(typeof(IExpression), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureChainExpressionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureChainExpressionComparer.cs new file mode 100644 index 000000000..f78d99116 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureChainExpressionComparer.cs @@ -0,0 +1,149 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class FeatureChainExpressionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IFeatureChainExpression x, IFeatureChainExpression y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!OrdinalStringComparer.Equals(x.Operator, y.Operator)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IFeatureChainExpression obj) + { + return HashCode.Combine(typeof(IFeatureChainExpression), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureChainingComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureChainingComparer.cs new file mode 100644 index 000000000..b0bedc184 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureChainingComparer.cs @@ -0,0 +1,132 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Core.Features; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class FeatureChainingComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IFeatureChaining x, IFeatureChaining y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (x.ChainingFeature != y.ChainingFeature) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IFeatureChaining obj) + { + return HashCode.Combine(typeof(IFeatureChaining), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureComparer.cs new file mode 100644 index 000000000..9e147f764 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureComparer.cs @@ -0,0 +1,147 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Core.Features; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class FeatureComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IFeature x, IFeature y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IFeature obj) + { + return HashCode.Combine(typeof(IFeature), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureInvertingComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureInvertingComparer.cs new file mode 100644 index 000000000..b19c62164 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureInvertingComparer.cs @@ -0,0 +1,134 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Core.Features; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class FeatureInvertingComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IFeatureInverting x, IFeatureInverting y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.FeatureInverted != y.FeatureInverted) return false; + + if (x.InvertingFeature != y.InvertingFeature) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IFeatureInverting obj) + { + return HashCode.Combine(typeof(IFeatureInverting), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureMembershipComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureMembershipComparer.cs new file mode 100644 index 000000000..c10ecb7a9 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureMembershipComparer.cs @@ -0,0 +1,133 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Core.Types; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class FeatureMembershipComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IFeatureMembership x, IFeatureMembership y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Visibility != y.Visibility) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IFeatureMembership obj) + { + return HashCode.Combine(typeof(IFeatureMembership), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureReferenceExpressionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureReferenceExpressionComparer.cs new file mode 100644 index 000000000..db57d1349 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureReferenceExpressionComparer.cs @@ -0,0 +1,147 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class FeatureReferenceExpressionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IFeatureReferenceExpression x, IFeatureReferenceExpression y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IFeatureReferenceExpression obj) + { + return HashCode.Combine(typeof(IFeatureReferenceExpression), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureTypingComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureTypingComparer.cs new file mode 100644 index 000000000..1ababd5e4 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureTypingComparer.cs @@ -0,0 +1,134 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Core.Features; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class FeatureTypingComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IFeatureTyping x, IFeatureTyping y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Type != y.Type) return false; + + if (x.TypedFeature != y.TypedFeature) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IFeatureTyping obj) + { + return HashCode.Combine(typeof(IFeatureTyping), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureValueComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureValueComparer.cs new file mode 100644 index 000000000..db56f9ea2 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureValueComparer.cs @@ -0,0 +1,137 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Kernel.FeatureValues; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class FeatureValueComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IFeatureValue x, IFeatureValue y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsDefault != y.IsDefault) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsInitial != y.IsInitial) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Visibility != y.Visibility) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IFeatureValue obj) + { + return HashCode.Combine(typeof(IFeatureValue), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FlowComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FlowComparer.cs new file mode 100644 index 000000000..273559e59 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FlowComparer.cs @@ -0,0 +1,153 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Interactions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class FlowComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IFlow x, IFlow y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IFlow obj) + { + return HashCode.Combine(typeof(IFlow), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FlowDefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FlowDefinitionComparer.cs new file mode 100644 index 000000000..89231a8fc --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FlowDefinitionComparer.cs @@ -0,0 +1,138 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.Flows; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class FlowDefinitionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IFlowDefinition x, IFlowDefinition y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IFlowDefinition obj) + { + return HashCode.Combine(typeof(IFlowDefinition), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FlowEndComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FlowEndComparer.cs new file mode 100644 index 000000000..9828bdbf2 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FlowEndComparer.cs @@ -0,0 +1,147 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Interactions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class FlowEndComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IFlowEnd x, IFlowEnd y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IFlowEnd obj) + { + return HashCode.Combine(typeof(IFlowEnd), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FlowUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FlowUsageComparer.cs new file mode 100644 index 000000000..d6d354276 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FlowUsageComparer.cs @@ -0,0 +1,158 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Flows; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class FlowUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IFlowUsage x, IFlowUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IFlowUsage obj) + { + return HashCode.Combine(typeof(IFlowUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ForLoopActionUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ForLoopActionUsageComparer.cs new file mode 100644 index 000000000..5f30b78e2 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ForLoopActionUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Actions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ForLoopActionUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IForLoopActionUsage x, IForLoopActionUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IForLoopActionUsage obj) + { + return HashCode.Combine(typeof(IForLoopActionUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ForkNodeComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ForkNodeComparer.cs new file mode 100644 index 000000000..2a10a93e3 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ForkNodeComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Actions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ForkNodeComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IForkNode x, IForkNode y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IForkNode obj) + { + return HashCode.Combine(typeof(IForkNode), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FramedConcernMembershipComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FramedConcernMembershipComparer.cs new file mode 100644 index 000000000..17d8d9a1d --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FramedConcernMembershipComparer.cs @@ -0,0 +1,136 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.Systems.Requirements; + using SysML2.NET.Core.DTO.Systems.Requirements; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class FramedConcernMembershipComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IFramedConcernMembership x, IFramedConcernMembership y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.Kind != y.Kind) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Visibility != y.Visibility) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IFramedConcernMembership obj) + { + return HashCode.Combine(typeof(IFramedConcernMembership), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FunctionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FunctionComparer.cs new file mode 100644 index 000000000..f285bd76d --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FunctionComparer.cs @@ -0,0 +1,128 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Kernel.Functions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class FunctionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IFunction x, IFunction y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IFunction obj) + { + return HashCode.Combine(typeof(IFunction), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/IfActionUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/IfActionUsageComparer.cs new file mode 100644 index 000000000..384ab1103 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/IfActionUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Actions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class IfActionUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IIfActionUsage x, IIfActionUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IIfActionUsage obj) + { + return HashCode.Combine(typeof(IIfActionUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/IncludeUseCaseUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/IncludeUseCaseUsageComparer.cs new file mode 100644 index 000000000..a4615d9ea --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/IncludeUseCaseUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.UseCases; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class IncludeUseCaseUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IIncludeUseCaseUsage x, IIncludeUseCaseUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IIncludeUseCaseUsage obj) + { + return HashCode.Combine(typeof(IIncludeUseCaseUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/IndexExpressionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/IndexExpressionComparer.cs new file mode 100644 index 000000000..313f5dc04 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/IndexExpressionComparer.cs @@ -0,0 +1,149 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class IndexExpressionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IIndexExpression x, IIndexExpression y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!OrdinalStringComparer.Equals(x.Operator, y.Operator)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IIndexExpression obj) + { + return HashCode.Combine(typeof(IIndexExpression), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/InteractionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/InteractionComparer.cs new file mode 100644 index 000000000..74a9b5288 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/InteractionComparer.cs @@ -0,0 +1,134 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Kernel.Interactions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class InteractionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IInteraction x, IInteraction y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IInteraction obj) + { + return HashCode.Combine(typeof(IInteraction), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/InterfaceDefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/InterfaceDefinitionComparer.cs new file mode 100644 index 000000000..b2701d890 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/InterfaceDefinitionComparer.cs @@ -0,0 +1,138 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.Interfaces; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class InterfaceDefinitionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IInterfaceDefinition x, IInterfaceDefinition y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IInterfaceDefinition obj) + { + return HashCode.Combine(typeof(IInterfaceDefinition), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/InterfaceUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/InterfaceUsageComparer.cs new file mode 100644 index 000000000..9d2d46d5b --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/InterfaceUsageComparer.cs @@ -0,0 +1,158 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Interfaces; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class InterfaceUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IInterfaceUsage x, IInterfaceUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IInterfaceUsage obj) + { + return HashCode.Combine(typeof(IInterfaceUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/IntersectingComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/IntersectingComparer.cs new file mode 100644 index 000000000..7a73eb684 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/IntersectingComparer.cs @@ -0,0 +1,132 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Core.Types; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class IntersectingComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IIntersecting x, IIntersecting y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IntersectingType != y.IntersectingType) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IIntersecting obj) + { + return HashCode.Combine(typeof(IIntersecting), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/InvariantComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/InvariantComparer.cs new file mode 100644 index 000000000..50e96fdf9 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/InvariantComparer.cs @@ -0,0 +1,149 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Functions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class InvariantComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IInvariant x, IInvariant y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsNegated != y.IsNegated) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IInvariant obj) + { + return HashCode.Combine(typeof(IInvariant), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/InvocationExpressionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/InvocationExpressionComparer.cs new file mode 100644 index 000000000..4d47c1f12 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/InvocationExpressionComparer.cs @@ -0,0 +1,147 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class InvocationExpressionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IInvocationExpression x, IInvocationExpression y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IInvocationExpression obj) + { + return HashCode.Combine(typeof(IInvocationExpression), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ItemDefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ItemDefinitionComparer.cs new file mode 100644 index 000000000..ba395d5d9 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ItemDefinitionComparer.cs @@ -0,0 +1,132 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.Items; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ItemDefinitionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IItemDefinition x, IItemDefinition y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IItemDefinition obj) + { + return HashCode.Combine(typeof(IItemDefinition), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ItemUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ItemUsageComparer.cs new file mode 100644 index 000000000..5fa005a56 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ItemUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Items; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ItemUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IItemUsage x, IItemUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IItemUsage obj) + { + return HashCode.Combine(typeof(IItemUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/JoinNodeComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/JoinNodeComparer.cs new file mode 100644 index 000000000..fa86b31e6 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/JoinNodeComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Actions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class JoinNodeComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IJoinNode x, IJoinNode y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IJoinNode obj) + { + return HashCode.Combine(typeof(IJoinNode), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/LibraryPackageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/LibraryPackageComparer.cs new file mode 100644 index 000000000..c001b1824 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/LibraryPackageComparer.cs @@ -0,0 +1,126 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Kernel.Packages; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class LibraryPackageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ILibraryPackage x, ILibraryPackage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsStandard != y.IsStandard) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ILibraryPackage obj) + { + return HashCode.Combine(typeof(ILibraryPackage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/LiteralBooleanComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/LiteralBooleanComparer.cs new file mode 100644 index 000000000..5f0462381 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/LiteralBooleanComparer.cs @@ -0,0 +1,149 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class LiteralBooleanComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ILiteralBoolean x, ILiteralBoolean y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Value != y.Value) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ILiteralBoolean obj) + { + return HashCode.Combine(typeof(ILiteralBoolean), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/LiteralExpressionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/LiteralExpressionComparer.cs new file mode 100644 index 000000000..8ebf3de1d --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/LiteralExpressionComparer.cs @@ -0,0 +1,147 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class LiteralExpressionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ILiteralExpression x, ILiteralExpression y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ILiteralExpression obj) + { + return HashCode.Combine(typeof(ILiteralExpression), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/LiteralInfinityComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/LiteralInfinityComparer.cs new file mode 100644 index 000000000..57a646ed2 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/LiteralInfinityComparer.cs @@ -0,0 +1,147 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class LiteralInfinityComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ILiteralInfinity x, ILiteralInfinity y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ILiteralInfinity obj) + { + return HashCode.Combine(typeof(ILiteralInfinity), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/LiteralIntegerComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/LiteralIntegerComparer.cs new file mode 100644 index 000000000..3aca24a47 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/LiteralIntegerComparer.cs @@ -0,0 +1,149 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class LiteralIntegerComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ILiteralInteger x, ILiteralInteger y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Value != y.Value) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ILiteralInteger obj) + { + return HashCode.Combine(typeof(ILiteralInteger), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/LiteralRationalComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/LiteralRationalComparer.cs new file mode 100644 index 000000000..03e258c17 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/LiteralRationalComparer.cs @@ -0,0 +1,149 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class LiteralRationalComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ILiteralRational x, ILiteralRational y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (FloatingPointComparer.NearlyEqual(x.Value, y.Value, FloatingPointComparer.DefaultDoubleEpsilon)) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ILiteralRational obj) + { + return HashCode.Combine(typeof(ILiteralRational), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/LiteralStringComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/LiteralStringComparer.cs new file mode 100644 index 000000000..c7ead324c --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/LiteralStringComparer.cs @@ -0,0 +1,149 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class LiteralStringComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ILiteralString x, ILiteralString y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (!OrdinalStringComparer.Equals(x.Value, y.Value)) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ILiteralString obj) + { + return HashCode.Combine(typeof(ILiteralString), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MembershipComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MembershipComparer.cs new file mode 100644 index 000000000..404836a4f --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MembershipComparer.cs @@ -0,0 +1,139 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Root.Namespaces; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class MembershipComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IMembership x, IMembership y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.MemberElement != y.MemberElement) return false; + + if (!OrdinalStringComparer.Equals(x.MemberName, y.MemberName)) return false; + + if (!OrdinalStringComparer.Equals(x.MemberShortName, y.MemberShortName)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Visibility != y.Visibility) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IMembership obj) + { + return HashCode.Combine(typeof(IMembership), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MembershipExposeComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MembershipExposeComparer.cs new file mode 100644 index 000000000..e7e74857e --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MembershipExposeComparer.cs @@ -0,0 +1,139 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Systems.Views; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class MembershipExposeComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IMembershipExpose x, IMembershipExpose y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.ImportedMembership != y.ImportedMembership) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsImportAll != y.IsImportAll) return false; + + if (x.IsRecursive != y.IsRecursive) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Visibility != y.Visibility) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IMembershipExpose obj) + { + return HashCode.Combine(typeof(IMembershipExpose), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MembershipImportComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MembershipImportComparer.cs new file mode 100644 index 000000000..0c0785dd7 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MembershipImportComparer.cs @@ -0,0 +1,139 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Root.Namespaces; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class MembershipImportComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IMembershipImport x, IMembershipImport y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.ImportedMembership != y.ImportedMembership) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsImportAll != y.IsImportAll) return false; + + if (x.IsRecursive != y.IsRecursive) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Visibility != y.Visibility) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IMembershipImport obj) + { + return HashCode.Combine(typeof(IMembershipImport), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MergeNodeComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MergeNodeComparer.cs new file mode 100644 index 000000000..66b92cf24 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MergeNodeComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Actions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class MergeNodeComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IMergeNode x, IMergeNode y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IMergeNode obj) + { + return HashCode.Combine(typeof(IMergeNode), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MetaclassComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MetaclassComparer.cs new file mode 100644 index 000000000..426935791 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MetaclassComparer.cs @@ -0,0 +1,128 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Kernel.Metadata; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class MetaclassComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IMetaclass x, IMetaclass y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IMetaclass obj) + { + return HashCode.Combine(typeof(IMetaclass), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MetadataAccessExpressionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MetadataAccessExpressionComparer.cs new file mode 100644 index 000000000..db168f19e --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MetadataAccessExpressionComparer.cs @@ -0,0 +1,147 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class MetadataAccessExpressionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IMetadataAccessExpression x, IMetadataAccessExpression y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IMetadataAccessExpression obj) + { + return HashCode.Combine(typeof(IMetadataAccessExpression), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MetadataDefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MetadataDefinitionComparer.cs new file mode 100644 index 000000000..781b8a49f --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MetadataDefinitionComparer.cs @@ -0,0 +1,132 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.Metadata; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class MetadataDefinitionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IMetadataDefinition x, IMetadataDefinition y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IMetadataDefinition obj) + { + return HashCode.Combine(typeof(IMetadataDefinition), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MetadataFeatureComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MetadataFeatureComparer.cs new file mode 100644 index 000000000..094f454e4 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MetadataFeatureComparer.cs @@ -0,0 +1,147 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Metadata; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class MetadataFeatureComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IMetadataFeature x, IMetadataFeature y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IMetadataFeature obj) + { + return HashCode.Combine(typeof(IMetadataFeature), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MetadataUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MetadataUsageComparer.cs new file mode 100644 index 000000000..86cb8c8eb --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MetadataUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Metadata; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class MetadataUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IMetadataUsage x, IMetadataUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IMetadataUsage obj) + { + return HashCode.Combine(typeof(IMetadataUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MultiplicityComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MultiplicityComparer.cs new file mode 100644 index 000000000..e10806a42 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MultiplicityComparer.cs @@ -0,0 +1,147 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Core.Types; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class MultiplicityComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IMultiplicity x, IMultiplicity y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IMultiplicity obj) + { + return HashCode.Combine(typeof(IMultiplicity), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MultiplicityRangeComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MultiplicityRangeComparer.cs new file mode 100644 index 000000000..d5acd64ea --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MultiplicityRangeComparer.cs @@ -0,0 +1,147 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Multiplicities; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class MultiplicityRangeComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IMultiplicityRange x, IMultiplicityRange y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IMultiplicityRange obj) + { + return HashCode.Combine(typeof(IMultiplicityRange), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/NamespaceComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/NamespaceComparer.cs new file mode 100644 index 000000000..ed5c7a00a --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/NamespaceComparer.cs @@ -0,0 +1,124 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Root.Namespaces; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class NamespaceComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(INamespace x, INamespace y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(INamespace obj) + { + return HashCode.Combine(typeof(INamespace), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/NamespaceExposeComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/NamespaceExposeComparer.cs new file mode 100644 index 000000000..73292f960 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/NamespaceExposeComparer.cs @@ -0,0 +1,139 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Systems.Views; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class NamespaceExposeComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(INamespaceExpose x, INamespaceExpose y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.ImportedNamespace != y.ImportedNamespace) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsImportAll != y.IsImportAll) return false; + + if (x.IsRecursive != y.IsRecursive) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Visibility != y.Visibility) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(INamespaceExpose obj) + { + return HashCode.Combine(typeof(INamespaceExpose), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/NamespaceImportComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/NamespaceImportComparer.cs new file mode 100644 index 000000000..24cd60cd4 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/NamespaceImportComparer.cs @@ -0,0 +1,139 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Root.Namespaces; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class NamespaceImportComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(INamespaceImport x, INamespaceImport y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.ImportedNamespace != y.ImportedNamespace) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsImportAll != y.IsImportAll) return false; + + if (x.IsRecursive != y.IsRecursive) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Visibility != y.Visibility) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(INamespaceImport obj) + { + return HashCode.Combine(typeof(INamespaceImport), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/NullExpressionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/NullExpressionComparer.cs new file mode 100644 index 000000000..ac3e974d2 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/NullExpressionComparer.cs @@ -0,0 +1,147 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class NullExpressionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(INullExpression x, INullExpression y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(INullExpression obj) + { + return HashCode.Combine(typeof(INullExpression), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ObjectiveMembershipComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ObjectiveMembershipComparer.cs new file mode 100644 index 000000000..54fda7704 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ObjectiveMembershipComparer.cs @@ -0,0 +1,133 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Systems.Cases; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ObjectiveMembershipComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IObjectiveMembership x, IObjectiveMembership y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Visibility != y.Visibility) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IObjectiveMembership obj) + { + return HashCode.Combine(typeof(IObjectiveMembership), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/OccurrenceDefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/OccurrenceDefinitionComparer.cs new file mode 100644 index 000000000..129109248 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/OccurrenceDefinitionComparer.cs @@ -0,0 +1,132 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.Occurrences; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class OccurrenceDefinitionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IOccurrenceDefinition x, IOccurrenceDefinition y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IOccurrenceDefinition obj) + { + return HashCode.Combine(typeof(IOccurrenceDefinition), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/OccurrenceUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/OccurrenceUsageComparer.cs new file mode 100644 index 000000000..e3cc35221 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/OccurrenceUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Occurrences; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class OccurrenceUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IOccurrenceUsage x, IOccurrenceUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IOccurrenceUsage obj) + { + return HashCode.Combine(typeof(IOccurrenceUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/OperatorExpressionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/OperatorExpressionComparer.cs new file mode 100644 index 000000000..50f1072d4 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/OperatorExpressionComparer.cs @@ -0,0 +1,149 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class OperatorExpressionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IOperatorExpression x, IOperatorExpression y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!OrdinalStringComparer.Equals(x.Operator, y.Operator)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IOperatorExpression obj) + { + return HashCode.Combine(typeof(IOperatorExpression), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/OwningMembershipComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/OwningMembershipComparer.cs new file mode 100644 index 000000000..b17495240 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/OwningMembershipComparer.cs @@ -0,0 +1,133 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Root.Namespaces; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class OwningMembershipComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IOwningMembership x, IOwningMembership y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Visibility != y.Visibility) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IOwningMembership obj) + { + return HashCode.Combine(typeof(IOwningMembership), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PackageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PackageComparer.cs new file mode 100644 index 000000000..44e4d9e56 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PackageComparer.cs @@ -0,0 +1,124 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Kernel.Packages; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class PackageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IPackage x, IPackage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IPackage obj) + { + return HashCode.Combine(typeof(IPackage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ParameterMembershipComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ParameterMembershipComparer.cs new file mode 100644 index 000000000..52c7e523c --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ParameterMembershipComparer.cs @@ -0,0 +1,133 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Kernel.Behaviors; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ParameterMembershipComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IParameterMembership x, IParameterMembership y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Visibility != y.Visibility) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IParameterMembership obj) + { + return HashCode.Combine(typeof(IParameterMembership), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PartDefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PartDefinitionComparer.cs new file mode 100644 index 000000000..8bc63b2c0 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PartDefinitionComparer.cs @@ -0,0 +1,132 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.Parts; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class PartDefinitionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IPartDefinition x, IPartDefinition y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IPartDefinition obj) + { + return HashCode.Combine(typeof(IPartDefinition), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PartUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PartUsageComparer.cs new file mode 100644 index 000000000..66b68953c --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PartUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Parts; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class PartUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IPartUsage x, IPartUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IPartUsage obj) + { + return HashCode.Combine(typeof(IPartUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PayloadFeatureComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PayloadFeatureComparer.cs new file mode 100644 index 000000000..13d777c2b --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PayloadFeatureComparer.cs @@ -0,0 +1,147 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Interactions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class PayloadFeatureComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IPayloadFeature x, IPayloadFeature y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IPayloadFeature obj) + { + return HashCode.Combine(typeof(IPayloadFeature), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PerformActionUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PerformActionUsageComparer.cs new file mode 100644 index 000000000..da0e9ac8b --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PerformActionUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Actions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class PerformActionUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IPerformActionUsage x, IPerformActionUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IPerformActionUsage obj) + { + return HashCode.Combine(typeof(IPerformActionUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PortConjugationComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PortConjugationComparer.cs new file mode 100644 index 000000000..570a0d4fa --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PortConjugationComparer.cs @@ -0,0 +1,134 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.Ports; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class PortConjugationComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IPortConjugation x, IPortConjugation y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (x.ConjugatedType != y.ConjugatedType) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.OriginalPortDefinition != y.OriginalPortDefinition) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IPortConjugation obj) + { + return HashCode.Combine(typeof(IPortConjugation), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PortDefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PortDefinitionComparer.cs new file mode 100644 index 000000000..856078019 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PortDefinitionComparer.cs @@ -0,0 +1,132 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.Ports; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class PortDefinitionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IPortDefinition x, IPortDefinition y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IPortDefinition obj) + { + return HashCode.Combine(typeof(IPortDefinition), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PortUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PortUsageComparer.cs new file mode 100644 index 000000000..5b51b3a8b --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PortUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Ports; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class PortUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IPortUsage x, IPortUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IPortUsage obj) + { + return HashCode.Combine(typeof(IPortUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PredicateComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PredicateComparer.cs new file mode 100644 index 000000000..407356c2e --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PredicateComparer.cs @@ -0,0 +1,128 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Kernel.Functions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class PredicateComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IPredicate x, IPredicate y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IPredicate obj) + { + return HashCode.Combine(typeof(IPredicate), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RedefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RedefinitionComparer.cs new file mode 100644 index 000000000..c9e140375 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RedefinitionComparer.cs @@ -0,0 +1,134 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Core.Features; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class RedefinitionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IRedefinition x, IRedefinition y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.RedefinedFeature != y.RedefinedFeature) return false; + + if (x.RedefiningFeature != y.RedefiningFeature) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IRedefinition obj) + { + return HashCode.Combine(typeof(IRedefinition), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ReferenceSubsettingComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ReferenceSubsettingComparer.cs new file mode 100644 index 000000000..f7249b328 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ReferenceSubsettingComparer.cs @@ -0,0 +1,132 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Core.Features; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ReferenceSubsettingComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IReferenceSubsetting x, IReferenceSubsetting y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.ReferencedFeature != y.ReferencedFeature) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IReferenceSubsetting obj) + { + return HashCode.Combine(typeof(IReferenceSubsetting), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ReferenceUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ReferenceUsageComparer.cs new file mode 100644 index 000000000..9092c3974 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ReferenceUsageComparer.cs @@ -0,0 +1,147 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Systems.DefinitionAndUsage; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ReferenceUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IReferenceUsage x, IReferenceUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IReferenceUsage obj) + { + return HashCode.Combine(typeof(IReferenceUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RenderingDefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RenderingDefinitionComparer.cs new file mode 100644 index 000000000..228c1b031 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RenderingDefinitionComparer.cs @@ -0,0 +1,132 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.Views; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class RenderingDefinitionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IRenderingDefinition x, IRenderingDefinition y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IRenderingDefinition obj) + { + return HashCode.Combine(typeof(IRenderingDefinition), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RenderingUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RenderingUsageComparer.cs new file mode 100644 index 000000000..a8f4ee37b --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RenderingUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Views; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class RenderingUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IRenderingUsage x, IRenderingUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IRenderingUsage obj) + { + return HashCode.Combine(typeof(IRenderingUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RequirementConstraintMembershipComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RequirementConstraintMembershipComparer.cs new file mode 100644 index 000000000..e63d1170e --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RequirementConstraintMembershipComparer.cs @@ -0,0 +1,136 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.Systems.Requirements; + using SysML2.NET.Core.DTO.Systems.Requirements; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class RequirementConstraintMembershipComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IRequirementConstraintMembership x, IRequirementConstraintMembership y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.Kind != y.Kind) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Visibility != y.Visibility) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IRequirementConstraintMembership obj) + { + return HashCode.Combine(typeof(IRequirementConstraintMembership), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RequirementDefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RequirementDefinitionComparer.cs new file mode 100644 index 000000000..b914c1f72 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RequirementDefinitionComparer.cs @@ -0,0 +1,132 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.Requirements; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class RequirementDefinitionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IRequirementDefinition x, IRequirementDefinition y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (!OrdinalStringComparer.Equals(x.ReqId, y.ReqId)) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IRequirementDefinition obj) + { + return HashCode.Combine(typeof(IRequirementDefinition), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RequirementUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RequirementUsageComparer.cs new file mode 100644 index 000000000..a62c7cc1f --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RequirementUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Requirements; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class RequirementUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IRequirementUsage x, IRequirementUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + if (!OrdinalStringComparer.Equals(x.ReqId, y.ReqId)) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IRequirementUsage obj) + { + return HashCode.Combine(typeof(IRequirementUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RequirementVerificationMembershipComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RequirementVerificationMembershipComparer.cs new file mode 100644 index 000000000..638957122 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RequirementVerificationMembershipComparer.cs @@ -0,0 +1,136 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.Systems.Requirements; + using SysML2.NET.Core.DTO.Systems.VerificationCases; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class RequirementVerificationMembershipComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IRequirementVerificationMembership x, IRequirementVerificationMembership y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.Kind != y.Kind) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Visibility != y.Visibility) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IRequirementVerificationMembership obj) + { + return HashCode.Combine(typeof(IRequirementVerificationMembership), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ResultExpressionMembershipComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ResultExpressionMembershipComparer.cs new file mode 100644 index 000000000..f931ef907 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ResultExpressionMembershipComparer.cs @@ -0,0 +1,133 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Kernel.Functions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ResultExpressionMembershipComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IResultExpressionMembership x, IResultExpressionMembership y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Visibility != y.Visibility) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IResultExpressionMembership obj) + { + return HashCode.Combine(typeof(IResultExpressionMembership), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ReturnParameterMembershipComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ReturnParameterMembershipComparer.cs new file mode 100644 index 000000000..0d10bca44 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ReturnParameterMembershipComparer.cs @@ -0,0 +1,133 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Kernel.Functions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ReturnParameterMembershipComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IReturnParameterMembership x, IReturnParameterMembership y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Visibility != y.Visibility) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IReturnParameterMembership obj) + { + return HashCode.Combine(typeof(IReturnParameterMembership), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SatisfyRequirementUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SatisfyRequirementUsageComparer.cs new file mode 100644 index 000000000..5ce0a2095 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SatisfyRequirementUsageComparer.cs @@ -0,0 +1,154 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Requirements; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class SatisfyRequirementUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ISatisfyRequirementUsage x, ISatisfyRequirementUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsNegated != y.IsNegated) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + if (!OrdinalStringComparer.Equals(x.ReqId, y.ReqId)) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ISatisfyRequirementUsage obj) + { + return HashCode.Combine(typeof(ISatisfyRequirementUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SelectExpressionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SelectExpressionComparer.cs new file mode 100644 index 000000000..06113c5d2 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SelectExpressionComparer.cs @@ -0,0 +1,149 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Expressions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class SelectExpressionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ISelectExpression x, ISelectExpression y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!OrdinalStringComparer.Equals(x.Operator, y.Operator)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ISelectExpression obj) + { + return HashCode.Combine(typeof(ISelectExpression), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SendActionUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SendActionUsageComparer.cs new file mode 100644 index 000000000..34e837745 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SendActionUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Actions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class SendActionUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ISendActionUsage x, ISendActionUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ISendActionUsage obj) + { + return HashCode.Combine(typeof(ISendActionUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SpecializationComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SpecializationComparer.cs new file mode 100644 index 000000000..b4bdb1a44 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SpecializationComparer.cs @@ -0,0 +1,134 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Core.Types; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class SpecializationComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ISpecialization x, ISpecialization y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.General != y.General) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Specific != y.Specific) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ISpecialization obj) + { + return HashCode.Combine(typeof(ISpecialization), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/StakeholderMembershipComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/StakeholderMembershipComparer.cs new file mode 100644 index 000000000..7c0ac1341 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/StakeholderMembershipComparer.cs @@ -0,0 +1,133 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Systems.Requirements; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class StakeholderMembershipComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IStakeholderMembership x, IStakeholderMembership y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Visibility != y.Visibility) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IStakeholderMembership obj) + { + return HashCode.Combine(typeof(IStakeholderMembership), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/StateDefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/StateDefinitionComparer.cs new file mode 100644 index 000000000..ed71a3090 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/StateDefinitionComparer.cs @@ -0,0 +1,134 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.States; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class StateDefinitionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IStateDefinition x, IStateDefinition y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsParallel != y.IsParallel) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IStateDefinition obj) + { + return HashCode.Combine(typeof(IStateDefinition), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/StateSubactionMembershipComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/StateSubactionMembershipComparer.cs new file mode 100644 index 000000000..6d9489c9a --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/StateSubactionMembershipComparer.cs @@ -0,0 +1,136 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.Systems.States; + using SysML2.NET.Core.DTO.Systems.States; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class StateSubactionMembershipComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IStateSubactionMembership x, IStateSubactionMembership y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.Kind != y.Kind) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Visibility != y.Visibility) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IStateSubactionMembership obj) + { + return HashCode.Combine(typeof(IStateSubactionMembership), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/StateUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/StateUsageComparer.cs new file mode 100644 index 000000000..c5b14ce88 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/StateUsageComparer.cs @@ -0,0 +1,154 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.States; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class StateUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IStateUsage x, IStateUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsParallel != y.IsParallel) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IStateUsage obj) + { + return HashCode.Combine(typeof(IStateUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/StepComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/StepComparer.cs new file mode 100644 index 000000000..1eb734f49 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/StepComparer.cs @@ -0,0 +1,147 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Behaviors; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class StepComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IStep x, IStep y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IStep obj) + { + return HashCode.Combine(typeof(IStep), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/StructureComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/StructureComparer.cs new file mode 100644 index 000000000..4327d99f9 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/StructureComparer.cs @@ -0,0 +1,128 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Kernel.Structures; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class StructureComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IStructure x, IStructure y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IStructure obj) + { + return HashCode.Combine(typeof(IStructure), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SubclassificationComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SubclassificationComparer.cs new file mode 100644 index 000000000..f4e341b15 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SubclassificationComparer.cs @@ -0,0 +1,134 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Core.Classifiers; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class SubclassificationComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ISubclassification x, ISubclassification y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Subclassifier != y.Subclassifier) return false; + + if (x.Superclassifier != y.Superclassifier) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ISubclassification obj) + { + return HashCode.Combine(typeof(ISubclassification), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SubjectMembershipComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SubjectMembershipComparer.cs new file mode 100644 index 000000000..0b76e6f28 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SubjectMembershipComparer.cs @@ -0,0 +1,133 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Systems.Requirements; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class SubjectMembershipComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ISubjectMembership x, ISubjectMembership y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Visibility != y.Visibility) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ISubjectMembership obj) + { + return HashCode.Combine(typeof(ISubjectMembership), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SubsettingComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SubsettingComparer.cs new file mode 100644 index 000000000..a7ac080fa --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SubsettingComparer.cs @@ -0,0 +1,134 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Core.Features; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class SubsettingComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ISubsetting x, ISubsetting y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.SubsettedFeature != y.SubsettedFeature) return false; + + if (x.SubsettingFeature != y.SubsettingFeature) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ISubsetting obj) + { + return HashCode.Combine(typeof(ISubsetting), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SuccessionAsUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SuccessionAsUsageComparer.cs new file mode 100644 index 000000000..f631d8ce0 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SuccessionAsUsageComparer.cs @@ -0,0 +1,153 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Systems.Connections; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class SuccessionAsUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ISuccessionAsUsage x, ISuccessionAsUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ISuccessionAsUsage obj) + { + return HashCode.Combine(typeof(ISuccessionAsUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SuccessionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SuccessionComparer.cs new file mode 100644 index 000000000..76cfd9408 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SuccessionComparer.cs @@ -0,0 +1,153 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Connectors; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class SuccessionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ISuccession x, ISuccession y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ISuccession obj) + { + return HashCode.Combine(typeof(ISuccession), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SuccessionFlowComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SuccessionFlowComparer.cs new file mode 100644 index 000000000..786659393 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SuccessionFlowComparer.cs @@ -0,0 +1,153 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Interactions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class SuccessionFlowComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ISuccessionFlow x, ISuccessionFlow y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ISuccessionFlow obj) + { + return HashCode.Combine(typeof(ISuccessionFlow), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SuccessionFlowUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SuccessionFlowUsageComparer.cs new file mode 100644 index 000000000..a51ad7225 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SuccessionFlowUsageComparer.cs @@ -0,0 +1,158 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Flows; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class SuccessionFlowUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ISuccessionFlowUsage x, ISuccessionFlowUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ISuccessionFlowUsage obj) + { + return HashCode.Combine(typeof(ISuccessionFlowUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/TerminateActionUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/TerminateActionUsageComparer.cs new file mode 100644 index 000000000..5efda216e --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/TerminateActionUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Actions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class TerminateActionUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ITerminateActionUsage x, ITerminateActionUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ITerminateActionUsage obj) + { + return HashCode.Combine(typeof(ITerminateActionUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/TextualRepresentationComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/TextualRepresentationComparer.cs new file mode 100644 index 000000000..1f256011b --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/TextualRepresentationComparer.cs @@ -0,0 +1,128 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Root.Annotations; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class TextualRepresentationComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ITextualRepresentation x, ITextualRepresentation y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.Body, y.Body)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!OrdinalStringComparer.Equals(x.Language, y.Language)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ITextualRepresentation obj) + { + return HashCode.Combine(typeof(ITextualRepresentation), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/TransitionFeatureMembershipComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/TransitionFeatureMembershipComparer.cs new file mode 100644 index 000000000..941289f08 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/TransitionFeatureMembershipComparer.cs @@ -0,0 +1,136 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.Systems.States; + using SysML2.NET.Core.DTO.Systems.States; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class TransitionFeatureMembershipComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ITransitionFeatureMembership x, ITransitionFeatureMembership y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.Kind != y.Kind) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Visibility != y.Visibility) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ITransitionFeatureMembership obj) + { + return HashCode.Combine(typeof(ITransitionFeatureMembership), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/TransitionUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/TransitionUsageComparer.cs new file mode 100644 index 000000000..20a3e1cad --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/TransitionUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.States; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class TransitionUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ITransitionUsage x, ITransitionUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ITransitionUsage obj) + { + return HashCode.Combine(typeof(ITransitionUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/TriggerInvocationExpressionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/TriggerInvocationExpressionComparer.cs new file mode 100644 index 000000000..3d0bd57c3 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/TriggerInvocationExpressionComparer.cs @@ -0,0 +1,150 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Actions; + using SysML2.NET.Core.DTO.Systems.Actions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class TriggerInvocationExpressionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ITriggerInvocationExpression x, ITriggerInvocationExpression y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariable != y.IsVariable) return false; + + if (x.Kind != y.Kind) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ITriggerInvocationExpression obj) + { + return HashCode.Combine(typeof(ITriggerInvocationExpression), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/TypeComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/TypeComparer.cs new file mode 100644 index 000000000..34a83496e --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/TypeComparer.cs @@ -0,0 +1,128 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Core.Types; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class TypeComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IType x, IType y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IType obj) + { + return HashCode.Combine(typeof(IType), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/TypeFeaturingComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/TypeFeaturingComparer.cs new file mode 100644 index 000000000..e56520a90 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/TypeFeaturingComparer.cs @@ -0,0 +1,134 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Core.Features; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class TypeFeaturingComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(ITypeFeaturing x, ITypeFeaturing y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.FeatureOfType != y.FeatureOfType) return false; + + if (x.FeaturingType != y.FeaturingType) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(ITypeFeaturing obj) + { + return HashCode.Combine(typeof(ITypeFeaturing), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/UnioningComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/UnioningComparer.cs new file mode 100644 index 000000000..5cf799386 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/UnioningComparer.cs @@ -0,0 +1,132 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Core.Types; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class UnioningComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IUnioning x, IUnioning y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.UnioningType != y.UnioningType) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IUnioning obj) + { + return HashCode.Combine(typeof(IUnioning), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/UsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/UsageComparer.cs new file mode 100644 index 000000000..925f3ccfc --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/UsageComparer.cs @@ -0,0 +1,147 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.DTO.Systems.DefinitionAndUsage; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class UsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IUsage x, IUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IUsage obj) + { + return HashCode.Combine(typeof(IUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/UseCaseDefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/UseCaseDefinitionComparer.cs new file mode 100644 index 000000000..d512aebf8 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/UseCaseDefinitionComparer.cs @@ -0,0 +1,132 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.UseCases; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class UseCaseDefinitionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IUseCaseDefinition x, IUseCaseDefinition y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IUseCaseDefinition obj) + { + return HashCode.Combine(typeof(IUseCaseDefinition), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/UseCaseUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/UseCaseUsageComparer.cs new file mode 100644 index 000000000..de7d9f7e6 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/UseCaseUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.UseCases; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class UseCaseUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IUseCaseUsage x, IUseCaseUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IUseCaseUsage obj) + { + return HashCode.Combine(typeof(IUseCaseUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/VariantMembershipComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/VariantMembershipComparer.cs new file mode 100644 index 000000000..10e8d6ef6 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/VariantMembershipComparer.cs @@ -0,0 +1,133 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Systems.DefinitionAndUsage; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class VariantMembershipComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IVariantMembership x, IVariantMembership y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Visibility != y.Visibility) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IVariantMembership obj) + { + return HashCode.Combine(typeof(IVariantMembership), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/VerificationCaseDefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/VerificationCaseDefinitionComparer.cs new file mode 100644 index 000000000..f4d4ffea5 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/VerificationCaseDefinitionComparer.cs @@ -0,0 +1,132 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.VerificationCases; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class VerificationCaseDefinitionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IVerificationCaseDefinition x, IVerificationCaseDefinition y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IVerificationCaseDefinition obj) + { + return HashCode.Combine(typeof(IVerificationCaseDefinition), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/VerificationCaseUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/VerificationCaseUsageComparer.cs new file mode 100644 index 000000000..66fd6a10a --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/VerificationCaseUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.VerificationCases; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class VerificationCaseUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IVerificationCaseUsage x, IVerificationCaseUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IVerificationCaseUsage obj) + { + return HashCode.Combine(typeof(IVerificationCaseUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ViewDefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ViewDefinitionComparer.cs new file mode 100644 index 000000000..c98552983 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ViewDefinitionComparer.cs @@ -0,0 +1,132 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.Views; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ViewDefinitionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IViewDefinition x, IViewDefinition y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IViewDefinition obj) + { + return HashCode.Combine(typeof(IViewDefinition), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ViewRenderingMembershipComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ViewRenderingMembershipComparer.cs new file mode 100644 index 000000000..c94c8e860 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ViewRenderingMembershipComparer.cs @@ -0,0 +1,133 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Root.Namespaces; + using SysML2.NET.Core.DTO.Systems.Views; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ViewRenderingMembershipComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IViewRenderingMembership x, IViewRenderingMembership y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsImplied != y.IsImplied) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelatedElement != y.OwningRelatedElement) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.Visibility != y.Visibility) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IViewRenderingMembership obj) + { + return HashCode.Combine(typeof(IViewRenderingMembership), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ViewUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ViewUsageComparer.cs new file mode 100644 index 000000000..29e61e99e --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ViewUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Views; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ViewUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IViewUsage x, IViewUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IViewUsage obj) + { + return HashCode.Combine(typeof(IViewUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ViewpointDefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ViewpointDefinitionComparer.cs new file mode 100644 index 000000000..0434ba4be --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ViewpointDefinitionComparer.cs @@ -0,0 +1,132 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.DTO.Systems.Views; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ViewpointDefinitionComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IViewpointDefinition x, IViewpointDefinition y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (!OrdinalStringComparer.Equals(x.ReqId, y.ReqId)) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IViewpointDefinition obj) + { + return HashCode.Combine(typeof(IViewpointDefinition), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ViewpointUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ViewpointUsageComparer.cs new file mode 100644 index 000000000..05b18851e --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ViewpointUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Views; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class ViewpointUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IViewpointUsage x, IViewpointUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + if (!OrdinalStringComparer.Equals(x.ReqId, y.ReqId)) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IViewpointUsage obj) + { + return HashCode.Combine(typeof(IViewpointUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/WhileLoopActionUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/WhileLoopActionUsageComparer.cs new file mode 100644 index 000000000..9d4d7dc71 --- /dev/null +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/WhileLoopActionUsageComparer.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Extensions.Core.DTO.Comparers +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + + using SysML2.NET.Core.Core.Types; + using SysML2.NET.Core.Systems.Occurrences; + using SysML2.NET.Core.DTO.Systems.Actions; + using SysML2.NET.Extensions.Comparers; + + /// + /// Provides an equality comparison for instances + /// based on their semantic content rather than object reference identity. + /// + /// + /// This comparer is intended for use in deserialization, testing, and model + /// validation scenarios where two instances + /// originating from different sources (e.g. JSON and MessagePack) must be + /// considered equal if they represent the same SysML v2 model element. + /// + [GeneratedCode("SysML2.NET", "latest")] + public sealed class WhileLoopActionUsageComparer : IEqualityComparer + { + /// + /// The used for all string comparisons performed + /// by this comparer. + /// + /// + /// is used to ensure culture-independent, + /// deterministic comparison semantics suitable for identifiers and + /// model-level string values. + /// + private static readonly StringComparer OrdinalStringComparer = StringComparer.Ordinal; + + /// + /// Determines whether two instances are equal. + /// + /// + /// The first to compare. + /// + /// + /// The second to compare. + /// + /// + /// true if both instances represent the same + /// according to their semantic content; otherwise, false. + /// + /// + /// This method performs a deep, deterministic comparison of all relevant + /// properties, ignoring object reference identity and any transient or + /// derived state. + /// + public bool Equals(IWhileLoopActionUsage x, IWhileLoopActionUsage y) + { + if (ReferenceEquals(x, y)) return true; + + if (x is null || y is null) return false; + + if (x.Id != y.Id) return false; + + if (!StringSequenceEquality.OrderedEqual(x.AliasIds, y.AliasIds)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + + if (x.Direction != y.Direction) return false; + + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + + if (x.IsAbstract != y.IsAbstract) return false; + + if (x.IsComposite != y.IsComposite) return false; + + if (x.IsConstant != y.IsConstant) return false; + + if (x.IsDerived != y.IsDerived) return false; + + if (x.IsEnd != y.IsEnd) return false; + + if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; + + if (x.IsIndividual != y.IsIndividual) return false; + + if (x.IsOrdered != y.IsOrdered) return false; + + if (x.IsPortion != y.IsPortion) return false; + + if (x.IsSufficient != y.IsSufficient) return false; + + if (x.IsUnique != y.IsUnique) return false; + + if (x.IsVariation != y.IsVariation) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; + + if (x.OwningRelationship != y.OwningRelationship) return false; + + if (x.PortionKind != y.PortionKind) return false; + + return true; + } + + /// + /// Returns a hash code for the specified . + /// + /// + /// The for which a hash code is to be returned. + /// + /// + /// A hash code based on the stable identity of the element. + /// + /// + /// The hash code is intentionally derived from the element identity only, + /// ensuring stability and compatibility with collection-based equality + /// checks + /// + public int GetHashCode(IWhileLoopActionUsage obj) + { + return HashCode.Combine(typeof(IWhileLoopActionUsage), obj.Id); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json.Tests/DeSerializerTestFixture.cs b/SysML2.NET.Serializer.Json.Tests/DeSerializerTestFixture.cs index 09d1df102..8c3a946b7 100644 --- a/SysML2.NET.Serializer.Json.Tests/DeSerializerTestFixture.cs +++ b/SysML2.NET.Serializer.Json.Tests/DeSerializerTestFixture.cs @@ -28,12 +28,10 @@ namespace SysML2.NET.Serializer.Json.Tests using NUnit.Framework; - using SysML2.NET.PIM.DTO; - using SysML2.NET.Core.DTO; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Core; using SysML2.NET.Core.Core.Types; using SysML2.NET.Core.DTO.Core.Features; + using SysML2.NET.PIM.DTO; + using SysML2.NET.Serializer.Json; /// /// Suite of tests for the @@ -41,7 +39,7 @@ namespace SysML2.NET.Serializer.Json.Tests [TestFixture] public class DeSerializerTestFixture { - private IDeSerializer deSerializer; + private DeSerializer deSerializer; [SetUp] public void SetUp() @@ -52,7 +50,7 @@ public void SetUp() [Test] [TestCase(false)] [TestCase(true)] - public void Verify_that_idada_from_sysmlcore_json_can_be_deserialized(bool shouldDeserializeDerivedProperties) + public void Verify_that_iData_from_sysmlcore_json_can_be_deserialized(bool shouldDeserializeDerivedProperties) { var fileName = Path.Combine(TestContext.CurrentContext.WorkDirectory, "Data", "projects.000e9890-6935-43e6-a5d7-5d7cac601f4c.commits.6d7ad9fd-6520-4ff2-885b-8c5c129e6c27.elements.json"); using var stream = new FileStream(fileName, FileMode.Open, FileAccess.Read); @@ -87,7 +85,7 @@ public void Verify_that_idada_from_sysmlcore_json_can_be_deserialized(bool shoul [Test] [TestCase(false)] [TestCase(true)] - public async Task Verify_that_idada_from_sysmlcore_json_can_be_deserialized_async(bool shouldDeserializeDerivedProperties) + public async Task Verify_that_iData_from_sysmlcore_json_can_be_deserialized_async(bool shouldDeserializeDerivedProperties) { var fileName = Path.Combine(TestContext.CurrentContext.WorkDirectory, "Data", "projects.000e9890-6935-43e6-a5d7-5d7cac601f4c.commits.6d7ad9fd-6520-4ff2-885b-8c5c129e6c27.elements.json"); diff --git a/SysML2.NET.Serializer.Json.Tests/JsonSerializeAndDeserializeTestFixture.cs b/SysML2.NET.Serializer.Json.Tests/JsonSerializeAndDeserializeTestFixture.cs new file mode 100644 index 000000000..d1a3040b9 --- /dev/null +++ b/SysML2.NET.Serializer.Json.Tests/JsonSerializeAndDeserializeTestFixture.cs @@ -0,0 +1,96 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2025 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Serializer.Json.Tests +{ + using System.IO; + using System.Linq; + using System.Text.Json; + + using NUnit.Framework; + + using SysML2.NET.Extensions.Core.DTO.Comparers; + + using SysML2.NET.Serializer.Json; + + /// + /// Suite of tests for the + /// + [TestFixture] + public class JsonSerializeAndDeserializeTestFixture + { + private DeSerializer deSerializer; + private Serializer serializer; + + [SetUp] + public void SetUp() + { + this.deSerializer = new DeSerializer(); + this.serializer = new Serializer(); + } + + [Test] + public void Verify_that_Deserialize_Serialize_and_Deserialize_yields_equal_objects() + { + var fileName = Path.Combine(TestContext.CurrentContext.WorkDirectory, "Data", "projects.000e9890-6935-43e6-a5d7-5d7cac601f4c.commits.6d7ad9fd-6520-4ff2-885b-8c5c129e6c27.elements.json"); + using var stream = new FileStream(fileName, FileMode.Open, FileAccess.Read); + + var jsonFileData = this.deSerializer.DeSerialize(stream, SerializationModeKind.JSON, SerializationTargetKind.CORE, false).ToList(); + + var jsonWriterOptions = new JsonWriterOptions { Indented = true }; + + var targetStream = new MemoryStream(); + + this.serializer.Serialize(jsonFileData, SerializationModeKind.JSON, false, targetStream, jsonWriterOptions); + + targetStream.Position = 0; + + var memoryStreamData = this.deSerializer.DeSerialize(targetStream, SerializationModeKind.JSON, SerializationTargetKind.CORE, false).ToList(); + + Assert.That(jsonFileData, Has.Count.EqualTo(memoryStreamData.Count)); + + var jsonFileById = jsonFileData.ToDictionary(x => x.Id); + var memoryStreamById = memoryStreamData.ToDictionary(x => x.Id); + + Assert.That(jsonFileById.Keys, Is.EquivalentTo(memoryStreamById.Keys)); + + using (Assert.EnterMultipleScope()) + { + foreach (var id in jsonFileById.Keys) + { + var left = jsonFileById[id]; + var right = memoryStreamById[id]; + + Assert.That( + right.GetType(), + Is.EqualTo(left.GetType()), + $"Type mismatch for id {id}. Left={left.GetType().FullName}, Right={right.GetType().FullName}"); + + var comparer = ComparerProvider.Resolve(left); + + Assert.That( + comparer.Equals(left, right), + Is.True, + $"Round-trip semantic mismatch for id {id} ({left.GetType().Name})."); + } + } + } + } +} diff --git a/SysML2.NET.Serializer.Json.Tests/SysML2.NET.Serializer.Json.Tests.csproj b/SysML2.NET.Serializer.Json.Tests/SysML2.NET.Serializer.Json.Tests.csproj index 7d062193d..141fc1756 100644 --- a/SysML2.NET.Serializer.Json.Tests/SysML2.NET.Serializer.Json.Tests.csproj +++ b/SysML2.NET.Serializer.Json.Tests/SysML2.NET.Serializer.Json.Tests.csproj @@ -35,6 +35,7 @@ + diff --git a/SysML2.NET.Serializer.MessagePack.Tests/Comparers/GuidComparerTestFixture.cs b/SysML2.NET.Serializer.MessagePack.Tests/Comparers/GuidComparerTestFixture.cs deleted file mode 100644 index 5e7f3b3b9..000000000 --- a/SysML2.NET.Serializer.MessagePack.Tests/Comparers/GuidComparerTestFixture.cs +++ /dev/null @@ -1,51 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2026 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Extensions.Tests.Comparers -{ - using System; - using System.Collections.Generic; - using System.Linq; - - using NUnit.Framework; - - using SysML2.NET.Extensions.Comparers; - - [TestFixture] - public class GuidComparerTestFixture - { - [Test] - public void Verify_that_List_of_Guid_is_ordered() - { - var id_1 = Guid.Parse("622d8e0f-ed5e-4dde-92b8-97ff06e69110"); - var id_2 = Guid.Parse("90e43d0c-edf8-4630-963b-90e6530ac9db"); - var id_3 = Guid.Parse("47b3abc1-ce06-40ef-8ea6-466e7eaccccd"); - - Assert.That(-1, Is.EqualTo(id_1.CompareTo(id_2))); - - var ids = new List { id_1, id_2, id_3 }; - var ordered = new List { id_3, id_1, id_2 }; - - var result = ids.OrderBy(x => x, new GuidComparer()); - - Assert.That(ordered, Is.EqualTo(result)); - } - } -} diff --git a/SysML2.NET.Serializer.MessagePack.Tests/SerializerTestFixture.cs b/SysML2.NET.Serializer.MessagePack.Tests/SerializerTestFixture.cs index 9fcd1643e..a55742252 100644 --- a/SysML2.NET.Serializer.MessagePack.Tests/SerializerTestFixture.cs +++ b/SysML2.NET.Serializer.MessagePack.Tests/SerializerTestFixture.cs @@ -20,24 +20,15 @@ namespace SysML2.NET.Serializer.MessagePack.Tests { - using System; using System.IO; using System.Linq; - using System.Threading; - using System.Threading.Tasks; using NUnit.Framework; - using SysML2.NET.PIM.DTO; - - using SysML2.NET.Core; - using SysML2.NET.Core.DTO; using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.MessagePack; - using SysML2.NET.Core.Core.Types; - using SysML2.NET.Core.DTO.Core.Features; - using SerializationTargetKind = MessagePack.SerializationTargetKind; + using SysML2.NET.Extensions.Core.DTO.Comparers; + using SerializationTargetKind = MessagePack.SerializationTargetKind; [TestFixture] public class SerializerTestFixture @@ -60,14 +51,11 @@ public void SetUp() public void Verify_that_iData_from_sysml2_core_json_can_be_deserialized() { var fileName = Path.Combine(TestContext.CurrentContext.WorkDirectory, "Data", "projects.000e9890-6935-43e6-a5d7-5d7cac601f4c.commits.6d7ad9fd-6520-4ff2-885b-8c5c129e6c27.elements.json"); - using var stream = new FileStream(fileName, FileMode.Open, FileAccess.Read); + using var jsonStream = new FileStream(fileName, FileMode.Open, FileAccess.Read); - var jsonData = this.jsonDeSerializer.DeSerialize(stream, SerializationModeKind.JSON, Json.SerializationTargetKind.CORE,false); + var jsonData = this.jsonDeSerializer.DeSerialize(jsonStream, SerializationModeKind.JSON, Json.SerializationTargetKind.CORE,false).ToList(); - using (Assert.EnterMultipleScope()) - { - Assert.That(jsonData.Count(), Is.EqualTo(100)); - } + Assert.That(jsonData.Count(), Is.EqualTo(100)); var messagePackStream = new MemoryStream(); @@ -75,12 +63,35 @@ public void Verify_that_iData_from_sysml2_core_json_can_be_deserialized() messagePackStream.Position = 0; - var messagePackData= this.messagePackDeSerializer.DeSerialize(messagePackStream, SerializationTargetKind.CORE); + var messagePackData= this.messagePackDeSerializer.DeSerialize(messagePackStream, SerializationTargetKind.CORE).ToList(); - var jsonBasedDictionary = jsonData.ToDictionary(x => x.Id); - var messagePackBasedDictionary = messagePackData.ToDictionary(x => x.Id); + Assert.That(messagePackData, Has.Count.EqualTo(jsonData.Count)); - Assert.That(jsonBasedDictionary.Keys, Is.EquivalentTo(messagePackBasedDictionary.Keys)); + var jsonById = jsonData.ToDictionary(x => x.Id); + var msgById = messagePackData.ToDictionary(x => x.Id); + + Assert.That(jsonById.Keys, Is.EquivalentTo(msgById.Keys)); + + using (Assert.EnterMultipleScope()) + { + foreach (var id in jsonById.Keys) + { + var left = jsonById[id]; + var right = msgById[id]; + + Assert.That( + right.GetType(), + Is.EqualTo(left.GetType()), + $"Type mismatch for id {id}. Left={left.GetType().FullName}, Right={right.GetType().FullName}"); + + var comparer = ComparerProvider.Resolve(left); + + Assert.That( + comparer.Equals(left, right), + Is.True, + $"Round-trip semantic mismatch for id {id} ({left.GetType().Name})."); + } + } } } } diff --git a/SysML2.NET.Serializer.MessagePack.Tests/SysML2.NET.Serializer.MessagePack.Tests.csproj b/SysML2.NET.Serializer.MessagePack.Tests/SysML2.NET.Serializer.MessagePack.Tests.csproj index dfb4adb4f..3c24f2c88 100644 --- a/SysML2.NET.Serializer.MessagePack.Tests/SysML2.NET.Serializer.MessagePack.Tests.csproj +++ b/SysML2.NET.Serializer.MessagePack.Tests/SysML2.NET.Serializer.MessagePack.Tests.csproj @@ -39,10 +39,6 @@ - - - - Always diff --git a/SysML2.NET.Serializer.MessagePack/Helpers/DataFormatterResolver.cs b/SysML2.NET.Serializer.MessagePack/Helpers/DataFormatterResolver.cs index 7f9289558..7e6be2d0b 100644 --- a/SysML2.NET.Serializer.MessagePack/Helpers/DataFormatterResolver.cs +++ b/SysML2.NET.Serializer.MessagePack/Helpers/DataFormatterResolver.cs @@ -31,7 +31,21 @@ namespace SysML2.NET.Serializer.MessagePack.Helpers /// public class DataFormatterResolver : IFormatterResolver { - // Resolver should be singleton. + /// + /// Gets the singleton instance of the . + /// + /// + /// + /// This resolver is implemented as a singleton to ensure that formatter + /// resolution is centralized, stateless, and allocation-free at runtime. + /// + /// + /// MessagePack resolvers are expected to be reusable and thread-safe. + /// Using a single shared instance avoids unnecessary allocations and + /// ensures consistent formatter behavior across all serialization and + /// deserialization operations. + /// + /// public static readonly IFormatterResolver Instance = new DataFormatterResolver(); /// From 3a80563b6b549df063b7afc4df367ceb0b061deb Mon Sep 17 00:00:00 2001 From: samatstarion Date: Sat, 7 Feb 2026 19:05:07 +0100 Subject: [PATCH 2/2] [SQ] improvements --- SysML2.NET.CodeGenerator/HandleBarHelpers/PropertyHelper.cs | 2 +- SysML2.NET.Extensions/Comparers/StringSequenceEquality.cs | 2 +- .../SerializerTestFixture.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/PropertyHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/PropertyHelper.cs index c94ed1372..97cda020d 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/PropertyHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/PropertyHelper.cs @@ -765,7 +765,7 @@ public static void RegisterPropertyHelper(this IHandlebars handlebars) var sb = new StringBuilder(); var propertyName = StringExtensions.CapitalizeFirstLetter(property.Name); - var isRedefinedPropertyInContext = property.TryQueryRedefinedByProperty(classContext, out var redefiningProperty); + var isRedefinedPropertyInContext = property.TryQueryRedefinedByProperty(classContext, out var _); if (isRedefinedPropertyInContext) { diff --git a/SysML2.NET.Extensions/Comparers/StringSequenceEquality.cs b/SysML2.NET.Extensions/Comparers/StringSequenceEquality.cs index 79394d13c..7d19d7d30 100644 --- a/SysML2.NET.Extensions/Comparers/StringSequenceEquality.cs +++ b/SysML2.NET.Extensions/Comparers/StringSequenceEquality.cs @@ -33,7 +33,7 @@ namespace SysML2.NET.Extensions.Comparers /// culture-independent behavior suitable for identifiers, names, and other /// model-level string values. /// - public class StringSequenceEquality + public static class StringSequenceEquality { /// /// Determines whether two string sequences are equal using an ordered diff --git a/SysML2.NET.Serializer.MessagePack.Tests/SerializerTestFixture.cs b/SysML2.NET.Serializer.MessagePack.Tests/SerializerTestFixture.cs index a55742252..4c8644011 100644 --- a/SysML2.NET.Serializer.MessagePack.Tests/SerializerTestFixture.cs +++ b/SysML2.NET.Serializer.MessagePack.Tests/SerializerTestFixture.cs @@ -55,7 +55,7 @@ public void Verify_that_iData_from_sysml2_core_json_can_be_deserialized() var jsonData = this.jsonDeSerializer.DeSerialize(jsonStream, SerializationModeKind.JSON, Json.SerializationTargetKind.CORE,false).ToList(); - Assert.That(jsonData.Count(), Is.EqualTo(100)); + Assert.That(jsonData.Count, Is.EqualTo(100)); var messagePackStream = new MemoryStream();