Record Class StunObserver.Observed
java.lang.Object
java.lang.Record
org.cloudburstmc.netty.util.nethernet.StunObserver.Observed
- Record Components:
fresh- Whether its mapping counted, being younger than the max age, at that pollusable- Whether its mapping is one players elsewhere can reachfreshUntilNanos- Until when its mapping counts, on the clock it was given
- Enclosing class:
- StunObserver
public static record StunObserver.Observed(StunObserver.Reading reading, boolean fresh, boolean usable, long freshUntilNanos)
extends Record
One address of the server as of the last poll.
-
Constructor Summary
ConstructorsConstructorDescriptionObserved(StunObserver.Reading reading, boolean fresh, boolean usable, long freshUntilNanos) Creates an instance of aObservedrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.booleanfresh()Returns the value of thefreshrecord component.longReturns the value of thefreshUntilNanosrecord component.final inthashCode()Returns a hash code value for this object.reading()Returns the value of thereadingrecord component.final StringtoString()Returns a string representation of this record class.booleanusable()Returns the value of theusablerecord component.
-
Constructor Details
-
Observed
Creates an instance of aObservedrecord class.- Parameters:
reading- the value for thereadingrecord componentfresh- the value for thefreshrecord componentusable- the value for theusablerecord componentfreshUntilNanos- the value for thefreshUntilNanosrecord component
-
-
Method Details
-
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 '=='. -
reading
Returns the value of thereadingrecord component.- Returns:
- the value of the
readingrecord component
-
fresh
public boolean fresh()Returns the value of thefreshrecord component.- Returns:
- the value of the
freshrecord component
-
usable
public boolean usable()Returns the value of theusablerecord component.- Returns:
- the value of the
usablerecord component
-
freshUntilNanos
public long freshUntilNanos()Returns the value of thefreshUntilNanosrecord component.- Returns:
- the value of the
freshUntilNanosrecord component
-