Record Class FPlayerImpl
java.lang.Object
java.lang.Record
net.flectone.pulse.model.entity.FPlayerImpl
- Record Components:
name- the player nameuuid- the player idtype- the entity typeid- the database idonline- whether they are connected right nowip- their address, or null if it is not knownshowEntityName- the name shown on hover, or null to use the plain name
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface FEntity
UNKNOWN_NAME, UNKNOWN_TYPE, UNKNOWN_UUIDFields inherited from interface FPlayer
CONSOLE_ID, CONSOLE_TYPE, INTEGRATION_TYPE, PLAYER_TYPE, UNKNOWN, UNKNOWN_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder()booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.@Nullable Stringip()Returns the value of theiprecord component.booleanWhether this is the console rather than a player.booleanWhether this sender came in through an integration.booleanisOnline()Whether the player is connected right now.name()Returns the value of thenamerecord component.booleanonline()Returns the value of theonlinerecord component.@Nullable net.kyori.adventure.text.ComponentReturns the value of theshowEntityNamerecord component.Starts a builder pre-filled with this player's values.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.uuid()Returns the value of theuuidrecord component.Returns a copy with a different database id.Returns a copy with a different address.Returns a copy with a different name.withOnline(boolean online) Returns a copy with a different online state.withShowEntityName(@Nullable net.kyori.adventure.text.Component showEntityName) Returns a copy with a different account id.
-
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 aFPlayerImplrecord class.- Parameters:
name- the value for thenamerecord componentuuid- the value for theuuidrecord componenttype- the value for thetyperecord componentid- the value for theidrecord componentonline- the value for theonlinerecord componentip- the value for theiprecord componentshowEntityName- the value for theshowEntityNamerecord component
-
-
Method Details
-
isConsole
-
isIntegration
public boolean isIntegration()Description copied from interface:FPlayerWhether this sender came in through an integration.- Specified by:
isIntegrationin interfaceFPlayer- Returns:
- true for an integration sender
-
isOnline
-
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 thecomparemethod from their corresponding wrapper classes. -
hashCode
-
builder
-
toBuilder
Description copied from interface:FPlayerStarts a builder pre-filled with this player's values. -
withName
Description copied from interface:FPlayerReturns a copy with a different name. -
withUuid
Description copied from interface:FPlayerReturns a copy with a different account id. -
withType
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withId
Description copied from interface:FPlayerReturns a copy with a different database id. -
withOnline
Description copied from interface:FPlayerReturns a copy with a different online state.- Specified by:
withOnlinein interfaceFPlayer- Parameters:
online- the new state- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withIp
Description copied from interface:FPlayerReturns a copy with a different address. -
withShowEntityName
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
toString
-
name
-
uuid
-
type
-
id
-
online
-
ip
-
showEntityName
public @Nullable net.kyori.adventure.text.Component showEntityName()Returns the value of theshowEntityNamerecord component.- Specified by:
showEntityNamein interfaceFEntity- Returns:
- the value of the
showEntityNamerecord component
-