Package com.tnsai.protocols.handlers
Record Class PubSubHandler.PublishResult
java.lang.Object
java.lang.Record
com.tnsai.protocols.handlers.PubSubHandler.PublishResult
- Enclosing class:
PubSubHandler
public static record PubSubHandler.PublishResult(String topic, int successCount, int failCount, long timestampMs)
extends Record
Result of a publish operation.
-
Constructor Summary
ConstructorsConstructorDescriptionPublishResult(String topic, int successCount, int failCount, long timestampMs) Creates an instance of aPublishResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intReturns the value of thefailCountrecord component.booleanfinal inthashCode()Returns a hash code value for this object.booleanintReturns the value of thesuccessCountrecord component.longReturns the value of thetimestampMsrecord component.topic()Returns the value of thetopicrecord component.final StringtoString()Returns a string representation of this record class.int
-
Constructor Details
-
PublishResult
Creates an instance of aPublishResultrecord class.- Parameters:
topic- the value for thetopicrecord componentsuccessCount- the value for thesuccessCountrecord componentfailCount- the value for thefailCountrecord componenttimestampMs- the value for thetimestampMsrecord component
-
-
Method Details
-
hasFailures
public boolean hasFailures() -
isFullyDelivered
public boolean isFullyDelivered() -
totalAttempts
public int totalAttempts() -
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
topic
Returns the value of thetopicrecord component.- Returns:
- the value of the
topicrecord component
-
successCount
public int successCount()Returns the value of thesuccessCountrecord component.- Returns:
- the value of the
successCountrecord component
-
failCount
public int failCount()Returns the value of thefailCountrecord component.- Returns:
- the value of the
failCountrecord component
-
timestampMs
public long timestampMs()Returns the value of thetimestampMsrecord component.- Returns:
- the value of the
timestampMsrecord component
-