Interface MUUID
@Immutable
public interface MUUID
The mindustry identity format. A combination of a UUID and a USID.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidThrows anIllegalArgumentExceptionif the given string is not a valid USID.static voidThrows anIllegalArgumentExceptionif the given string is not a valid UUID.static MUUIDfrom(mindustry.gen.Player player) Creates a new MUUID from aPlayer.static MUUIDfrom(mindustry.net.Administration.PlayerInfo info) Creates a new MUUID from aAdministration.PlayerInfo.getUsid()Returns the USID.default byte[]Returns the USID as decoded bytes.default longReturns the USID as a long.getUuid()Returns the UUID.default byte[]Returns the UUID as decoded bytes.default longReturns the UUID as a long.static booleanReturns whether the given string is a valid USID.static booleanReturns whether the given string is a valid UUID.static MUUIDof(long uuid, long usid) Creates a new MUUID from a long UUID and long USID.static MUUIDCreates a new MUUID from a UUID and USID.default UUIDConverts the uuid of this muuid into a realUUID, version 8.
-
Method Details
-
of
Creates a new MUUID from a UUID and USID.- Parameters:
uuid- the UUIDusid- the USID- Returns:
- the MUUID
-
of
Creates a new MUUID from a long UUID and long USID.- Parameters:
uuid- the UUIDusid- the USID- Returns:
- the MUUID
-
from
Creates a new MUUID from aPlayer.- Parameters:
player- the player- Returns:
- the MUUID
-
from
Creates a new MUUID from aAdministration.PlayerInfo.- Parameters:
info- the player info- Returns:
- the MUUID
-
isUuid
Returns whether the given string is a valid UUID.- Parameters:
uuid- the UUID to check- Returns:
- true if the given string is a valid UUID, false otherwise
-
checkUuid
Throws anIllegalArgumentExceptionif the given string is not a valid UUID. -
isUsid
Returns whether the given string is a valid USID.- Parameters:
usid- the USID to check- Returns:
- true if the given string is a valid USID, false otherwise
-
checkUsid
Throws anIllegalArgumentExceptionif the given string is not a valid USID. -
getUuid
String getUuid()Returns the UUID. -
getUuidAsBytes
default byte[] getUuidAsBytes()Returns the UUID as decoded bytes. -
getUuidAsLong
default long getUuidAsLong()Returns the UUID as a long. Beware the long does not include the crc32 checksum. -
getUsid
String getUsid()Returns the USID. -
getUsidAsBytes
default byte[] getUsidAsBytes()Returns the USID as decoded bytes. -
getUsidAsLong
default long getUsidAsLong()Returns the USID as a long. -
toRealUUID
Converts the uuid of this muuid into a realUUID, version 8.- See Also:
-