Record Class StunObserver.Reading
java.lang.Object
java.lang.Record
org.cloudburstmc.netty.util.nethernet.StunObserver.Reading
- Enclosing class:
- StunObserver
public static record StunObserver.Reading(InetSocketAddress server, @Nullable InetSocketAddress mapped, tel.schich.libdatachannel.StunBinding.State state, long successfulResponses, long failedTransactions, long mappingRevision, Optional<Duration> lastSuccessAge)
extends Record
What the native monitor reports for one address of the server: the mapping and its age are
empty before the first answer, and libjuice keeps the last mapping through later failures.
-
Constructor Summary
ConstructorsConstructorDescriptionReading(InetSocketAddress server, @Nullable InetSocketAddress mapped, tel.schich.libdatachannel.StunBinding.State state, long successfulResponses, long failedTransactions, long mappingRevision, Optional<Duration> lastSuccessAge) Creates an instance of aReadingrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleananswered()Whether the server has answered with a mapping.final booleanIndicates whether some other object is "equal to" this one.longReturns the value of thefailedTransactionsrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of thelastSuccessAgerecord component.@Nullable InetSocketAddressmapped()Returns the value of themappedrecord component.longReturns the value of themappingRevisionrecord component.server()Returns the value of theserverrecord component.tel.schich.libdatachannel.StunBinding.Statestate()Returns the value of thestaterecord component.longReturns the value of thesuccessfulResponsesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Reading
public Reading(InetSocketAddress server, @Nullable InetSocketAddress mapped, tel.schich.libdatachannel.StunBinding.State state, long successfulResponses, long failedTransactions, long mappingRevision, Optional<Duration> lastSuccessAge) Creates an instance of aReadingrecord class.- Parameters:
server- the value for theserverrecord componentmapped- the value for themappedrecord componentstate- the value for thestaterecord componentsuccessfulResponses- the value for thesuccessfulResponsesrecord componentfailedTransactions- the value for thefailedTransactionsrecord componentmappingRevision- the value for themappingRevisionrecord componentlastSuccessAge- the value for thelastSuccessAgerecord component
-
-
Method Details
-
answered
public boolean answered()Whether the server has answered with a mapping. -
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 '=='. -
server
Returns the value of theserverrecord component.- Returns:
- the value of the
serverrecord component
-
mapped
Returns the value of themappedrecord component.- Returns:
- the value of the
mappedrecord component
-
state
public tel.schich.libdatachannel.StunBinding.State state()Returns the value of thestaterecord component.- Returns:
- the value of the
staterecord component
-
successfulResponses
public long successfulResponses()Returns the value of thesuccessfulResponsesrecord component.- Returns:
- the value of the
successfulResponsesrecord component
-
failedTransactions
public long failedTransactions()Returns the value of thefailedTransactionsrecord component.- Returns:
- the value of the
failedTransactionsrecord component
-
mappingRevision
public long mappingRevision()Returns the value of themappingRevisionrecord component.- Returns:
- the value of the
mappingRevisionrecord component
-
lastSuccessAge
Returns the value of thelastSuccessAgerecord component.- Returns:
- the value of the
lastSuccessAgerecord component
-