Package org.spongepowered.api.profile
Interface GameProfile
-
- All Superinterfaces:
DataSerializable
,net.kyori.examination.Examinable
,Identifiable
,Identity
public interface GameProfile extends Identifiable, Identity, DataSerializable
Represents a profile of a user.Use the
UserManager
service to obtain the stored data associated with a profile.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
GameProfile.Factory
A factory forGameProfile
s.
-
Field Summary
-
Fields inherited from interface net.kyori.adventure.identity.Identity
DISPLAY_NAME, LOCALE, NAME, UUID
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
hasName()
Gets whether this game profile has a known name.java.util.Optional<java.lang.String>
name()
Gets the name associated with this profile.static GameProfile
of(java.util.UUID uniqueId)
Creates aGameProfile
from the provided ID.static GameProfile
of(java.util.UUID uniqueId, @Nullable java.lang.String name)
Creates aGameProfile
from the provided ID and name.java.util.List<ProfileProperty>
properties()
Gets an immutable list of all the properties in this game profile.default java.util.UUID
uuid()
GameProfile
withName(@Nullable java.lang.String name)
Gets a newGameProfile
with the given name.GameProfile
withoutProperties()
Gets a newGameProfile
with the same name and unique id of this profile, but without any of the properties.GameProfile
withoutProperties(java.lang.Iterable<ProfileProperty> properties)
Gets a newGameProfile
with the given property removed from to its properties.default GameProfile
withoutProperties(java.lang.String name)
Gets a newGameProfile
where the properties which have the given name are removed from its properties.GameProfile
withoutProperties(java.util.function.Predicate<ProfileProperty> filter)
Gets a newGameProfile
with where the properties that match the given filter are removed.GameProfile
withoutProperty(ProfileProperty property)
Gets a newGameProfile
with the given property removed from its properties.GameProfile
withProperties(java.lang.Iterable<ProfileProperty> properties)
Gets a newGameProfile
with the given properties added to its properties.GameProfile
withProperty(ProfileProperty property)
Gets a newGameProfile
with the given property added to its properties.-
Methods inherited from interface org.spongepowered.api.data.persistence.DataSerializable
contentVersion, toContainer
-
Methods inherited from interface org.spongepowered.api.util.Identifiable
uniqueId
-
Methods inherited from interface net.kyori.adventure.identity.Identity
examinableProperties
-
-
-
-
Method Detail
-
of
static GameProfile of(java.util.UUID uniqueId)
Creates aGameProfile
from the provided ID.The name of the created profile will be
null
.- Parameters:
uniqueId
- The unique id- Returns:
- The created profile
-
of
static GameProfile of(java.util.UUID uniqueId, @Nullable java.lang.String name)
Creates aGameProfile
from the provided ID and name.- Parameters:
uniqueId
- The unique idname
- The name- Returns:
- The created profile
-
name
java.util.Optional<java.lang.String> name()
Gets the name associated with this profile.- Returns:
- The associated name if present, otherwise
Optional.empty()
-
hasName
default boolean hasName()
Gets whether this game profile has a known name.- Returns:
- Whether the name is known
-
withName
GameProfile withName(@Nullable java.lang.String name)
Gets a newGameProfile
with the given name.- Parameters:
name
- The name- Returns:
- The new game profile
-
properties
java.util.List<ProfileProperty> properties()
Gets an immutable list of all the properties in this game profile.- Returns:
- The properties
-
withoutProperties
GameProfile withoutProperties()
Gets a newGameProfile
with the same name and unique id of this profile, but without any of the properties.- Returns:
- The new game profile
-
withProperties
GameProfile withProperties(java.lang.Iterable<ProfileProperty> properties)
Gets a newGameProfile
with the given properties added to its properties.- Parameters:
properties
- The profile properties to add- Returns:
- The new game profile
-
withProperty
GameProfile withProperty(ProfileProperty property)
Gets a newGameProfile
with the given property added to its properties.- Parameters:
property
- The profile property to add- Returns:
- The new game profile
-
withoutProperties
GameProfile withoutProperties(java.lang.Iterable<ProfileProperty> properties)
Gets a newGameProfile
with the given property removed from to its properties.- Parameters:
properties
- The profile properties to remove- Returns:
- The new game profile
-
withoutProperties
default GameProfile withoutProperties(java.lang.String name)
Gets a newGameProfile
where the properties which have the given name are removed from its properties.- Parameters:
name
- The profile property name to remove- Returns:
- The new game profile
-
withoutProperty
GameProfile withoutProperty(ProfileProperty property)
Gets a newGameProfile
with the given property removed from its properties.- Parameters:
property
- The profile property to remove- Returns:
- The new game profile
-
withoutProperties
GameProfile withoutProperties(java.util.function.Predicate<ProfileProperty> filter)
Gets a newGameProfile
with where the properties that match the given filter are removed.- Parameters:
filter
- The profile property filter- Returns:
- The new game profile
-
-