Record Class FPlayerImpl

java.lang.Object
java.lang.Record
net.flectone.pulse.model.entity.FPlayerImpl
Record Components:
name - the player name
uuid - the player id
type - the entity type
id - the database id
online - whether they are connected right now
ip - their address, or null if it is not known
showEntityName - the name shown on hover, or null to use the plain name
All Implemented Interfaces:
FEntity, FPlayer

public record FPlayerImpl(String name, UUID uuid, String type, Integer id, boolean online, @Nullable String ip, @Nullable net.kyori.adventure.text.Component showEntityName) extends Record implements FPlayer
A player
  • Constructor Details

    • FPlayerImpl

      public FPlayerImpl(String name, UUID uuid, String type, Integer id, boolean online, @Nullable String ip, @Nullable net.kyori.adventure.text.Component showEntityName)
      Creates an instance of a FPlayerImpl record class.
      Parameters:
      name - the value for the name record component
      uuid - the value for the uuid record component
      type - the value for the type record component
      id - the value for the id record component
      online - the value for the online record component
      ip - the value for the ip record component
      showEntityName - the value for the showEntityName record component
  • Method Details

    • isConsole

      public boolean isConsole()
      Description copied from interface: FPlayer
      Whether this is the console rather than a player.
      Specified by:
      isConsole in interface FPlayer
      Returns:
      true for the console
    • isIntegration

      public boolean isIntegration()
      Description copied from interface: FPlayer
      Whether this sender came in through an integration.
      Specified by:
      isIntegration in interface FPlayer
      Returns:
      true for an integration sender
    • isOnline

      public boolean isOnline()
      Description copied from interface: FPlayer
      Whether the player is connected right now.
      Specified by:
      isOnline in interface FPlayer
      Returns:
      true if online
    • equals

      public boolean equals(Object object)
      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 the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • hashCode

      public 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
    • builder

      public static FPlayerImpl.FPlayerImplBuilder builder()
    • toBuilder

      public FPlayerImpl.FPlayerImplBuilder toBuilder()
      Description copied from interface: FPlayer
      Starts a builder pre-filled with this player's values.
      Specified by:
      toBuilder in interface FPlayer
      Returns:
      the pre-filled builder
    • withName

      public FPlayerImpl withName(String name)
      Description copied from interface: FPlayer
      Returns a copy with a different name.
      Specified by:
      withName in interface FPlayer
      Parameters:
      name - the new name
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withUuid

      public FPlayerImpl withUuid(UUID uuid)
      Description copied from interface: FPlayer
      Returns a copy with a different account id.
      Specified by:
      withUuid in interface FPlayer
      Parameters:
      uuid - the new id
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withType

      public FPlayerImpl withType(String type)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withId

      public FPlayerImpl withId(Integer id)
      Description copied from interface: FPlayer
      Returns a copy with a different database id.
      Specified by:
      withId in interface FPlayer
      Parameters:
      id - the new id
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withOnline

      public FPlayerImpl withOnline(boolean online)
      Description copied from interface: FPlayer
      Returns a copy with a different online state.
      Specified by:
      withOnline in interface FPlayer
      Parameters:
      online - the new state
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withIp

      public FPlayerImpl withIp(@Nullable String ip)
      Description copied from interface: FPlayer
      Returns a copy with a different address.
      Specified by:
      withIp in interface FPlayer
      Parameters:
      ip - the new address
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withShowEntityName

      public FPlayerImpl withShowEntityName(@Nullable net.kyori.adventure.text.Component showEntityName)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • 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
    • name

      public String name()
      Returns the value of the name record component.
      Specified by:
      name in interface FEntity
      Returns:
      the value of the name record component
    • uuid

      public UUID uuid()
      Returns the value of the uuid record component.
      Specified by:
      uuid in interface FEntity
      Returns:
      the value of the uuid record component
    • type

      public String type()
      Returns the value of the type record component.
      Specified by:
      type in interface FEntity
      Returns:
      the value of the type record component
    • id

      public Integer id()
      Returns the value of the id record component.
      Specified by:
      id in interface FPlayer
      Returns:
      the value of the id record component
    • online

      public boolean online()
      Returns the value of the online record component.
      Returns:
      the value of the online record component
    • ip

      public @Nullable String ip()
      Returns the value of the ip record component.
      Specified by:
      ip in interface FPlayer
      Returns:
      the value of the ip record component
    • showEntityName

      public @Nullable net.kyori.adventure.text.Component showEntityName()
      Returns the value of the showEntityName record component.
      Specified by:
      showEntityName in interface FEntity
      Returns:
      the value of the showEntityName record component