Record Class PulsarTopic

java.lang.Object
java.lang.Record
org.springframework.pulsar.core.PulsarTopic
Record Components:
topicName - the topic name
numberOfPartitions - the number of partitions, or 0 for non-partitioned topics

public record PulsarTopic(String topicName, int numberOfPartitions) extends Record
Model class for a Pulsar topic. Use the PulsarTopicBuilder to create instances like this:

 	PulsarTopic topic = PulsarTopic.builder("topic-name").build();
 
Author:
Alexander Preuß
  • Constructor Details

    • PulsarTopic

      public PulsarTopic(String topicName, int numberOfPartitions)
      Creates an instance of a PulsarTopic record class.
      Parameters:
      topicName - the value for the topicName record component
      numberOfPartitions - the value for the numberOfPartitions record component
  • Method Details

    • builder

      public static PulsarTopicBuilder builder(String topicName)
    • isPartitioned

      public boolean isPartitioned()
      Checks if the topic is partitioned.
      Returns:
      true if the topic is partitioned
    • getComponents

      public org.springframework.pulsar.core.PulsarTopic.TopicComponents getComponents()
      Get the individual identifying components of a Pulsar topic.
      Returns:
      PulsarTopic.TopicComponents
    • getFullyQualifiedTopicName

      public String getFullyQualifiedTopicName()
      Get the fully-qualified name of the topic.
      Returns:
      the fully-qualified topic name
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • topicName

      public String topicName()
      Returns the value of the topicName record component.
      Returns:
      the value of the topicName record component
    • numberOfPartitions

      public int numberOfPartitions()
      Returns the value of the numberOfPartitions record component.
      Returns:
      the value of the numberOfPartitions record component