Description
Supported Script Types: Interface Scripts • Client Entity Scripts • Avatar Scripts • Server Entity Scripts • Assignment Client Scripts
TheUuid API provides facilities for working with UUIDs.Properties
| Name | Type | Summary |
|---|---|---|
| NULL | Uuid |
The null UUID, |
Methods
| Name | Return Value | Summary |
|---|---|---|
fromString
|
Uuid |
Generates a UUID from a string representation of the UUID. |
generate
|
Uuid |
Generates a new UUID. |
isEqual
|
boolean |
Tests whether two UUIDs are equal. |
isNull
|
boolean |
Tests whether a UUID is null. |
print
|
None |
Prints a UUID to the program log, as a text label followed by the UUID value. |
toString
|
string |
Generates a string representation of a UUID. However, because UUIDs are represented in JavaScript as strings, this is in effect a no-op. |
Method Details
|
(static) fromString( string ) → {Uuid}
Returns: A UUID if the given string is valid, null otherwise.
|
||||||
|---|---|---|---|---|---|---|
|
Generates a UUID from a string representation of the UUID. Parameters
ExampleValid and invalid parameters.
|
|
(static) generate( ) → {Uuid}
Returns: A new UUID. |
|---|
|
Generates a new UUID. ExampleGenerate a new UUID and reports its JavaScript type.
|
|
(static) isEqual( idA, idB ) → {boolean}
Returns: true if the two UUIDs are equal, otherwise false.
|
|||||||||
|---|---|---|---|---|---|---|---|---|---|
|
Tests whether two UUIDs are equal. Parameters
ExampleDemonstrate
|
|
(static) isNull( id ) → {boolean}
Returns: true if the UUID equals Uuid.NULL or is null, otherwise
false.
|
||||||
|---|---|---|---|---|---|---|
|
Tests whether a UUID is null. Parameters
ExampleDemonstrate
|
| (static) print( label, id ) | |||||||||
|---|---|---|---|---|---|---|---|---|---|
|
Prints a UUID to the program log, as a text label followed by the UUID value. Parameters
ExampleTwo ways of printing a label plus UUID.
|
|
(static) toString( id ) → {string}
Returns: - A string representation of the UUID. |
||||||
|---|---|---|---|---|---|---|
|
Generates a string representation of a UUID. However, because UUIDs are represented in JavaScript as strings, this is in effect a no-op. Parameters
|
