Class SolaceTopicArtifactMapping
- Assembly
- Solace.SchemaRegistry.Serdes.Core.dll
Default implementation of ISolaceTopicArtifactMapping that maps Solace topic expressions to schema registry artifact references using wildcard pattern matching.
public class SolaceTopicArtifactMapping : ISolaceTopicArtifactMapping
- Inheritance
-
SolaceTopicArtifactMapping
- Implements
- Inherited Members
Properties
ArtifactReference
Gets the mapped artifact reference.
public IArtifactReference ArtifactReference { get; }
Property Value
TopicExpression
Gets the topic expression.
public string TopicExpression { get; }
Property Value
Methods
Create(string)
Creates a mapping instance with a generated artifact ID. The generated artifact reference will contain the topic expression as the artifact ID.
public static SolaceTopicArtifactMapping Create(string topicExpression)
Parameters
topicExpressionstringThe topic expression for matching destination names. Must not be null or empty.
Returns
- SolaceTopicArtifactMapping
A SolaceTopicArtifactMapping instance with a generated IArtifactReference.
Exceptions
- ArgumentException
Thrown when
topicExpressionis null or empty.
Create(string, IArtifactReference)
Creates a mapping instance with an explicit IArtifactReference.
public static SolaceTopicArtifactMapping Create(string topicExpression, IArtifactReference artifactReference)
Parameters
topicExpressionstringThe topic expression for matching destination names. Must not be null or empty.
artifactReferenceIArtifactReferenceThe explicit IArtifactReference to map the destination name. Must not be null.
Returns
- SolaceTopicArtifactMapping
A SolaceTopicArtifactMapping instance with the explicit IArtifactReference.
Exceptions
- ArgumentException
Thrown when
topicExpressionis null or empty.- ArgumentNullException
Thrown when
artifactReferenceis null.
Create(string, string)
Creates a mapping instance with an explicit artifact ID. This creates an IArtifactReference with the provided artifact ID string.
public static SolaceTopicArtifactMapping Create(string topicExpression, string artifactId)
Parameters
topicExpressionstringThe topic expression for matching destination names. Must not be null or empty.
artifactIdstringThe artifact ID string to set on the generated IArtifactReference. Must not be null or empty.
Returns
- SolaceTopicArtifactMapping
A SolaceTopicArtifactMapping instance with a generated IArtifactReference.
Exceptions
- ArgumentException
Thrown when
topicExpressionorartifactIdis null or empty.
Equals(object)
Determines whether the specified object is equal to the current SolaceTopicArtifactMapping. Two mappings are equal if they have the same topic expression and artifact reference.
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with the current mapping.
Returns
- bool
trueif the specified object is equal to the current mapping; otherwise,false.
GetHashCode()
Serves as the default hash function for the SolaceTopicArtifactMapping type.
public override int GetHashCode()
Returns
- int
A hash code for the current mapping.
Match(string)
Method for matching a given destination name to a topic expression.
public bool Match(string destinationName)
Parameters
destinationNamestringThe destination name to test
Returns
- bool
True if the name matches the topic expression otherwise, false
Exceptions
- ArgumentNullException
Thrown when
destinationNameis null.