Record Class GlobalPortalId
java.lang.Object
java.lang.Record
org.sgrewritten.stargate.network.portal.GlobalPortalId
- Record Components:
portalId
-The locally unique id of a portal
networkId
-The id of the network the portal belongs to
A class representing a portal's global identifier
-
Constructor Summary
ConstructorDescriptionGlobalPortalId
(String portalId, String networkId) Creates an instance of aGlobalPortalId
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.static GlobalPortalId
getFromPortal
(Portal portal) Gets a global portal id from the given portalfinal int
hashCode()
Returns a hash code value for this object.Returns the value of thenetworkId
record component.portalId()
Returns the value of theportalId
record component.toString()
Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
getFromPortal
Gets a global portal id from the given portal- Parameters:
portal
-The portal to get the id for
- Returns:
The portal's id
-
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
portalId
Returns the value of theportalId
record component.- Returns:
- the value of the
portalId
record component
-
networkId
Returns the value of thenetworkId
record component.- Returns:
- the value of the
networkId
record component
-