Package xyz.gmitch215.socketmc.screen
Class AbstractScreen
java.lang.Object
xyz.gmitch215.socketmc.screen.AbstractScreen
- All Implemented Interfaces:
Serializable
,Narratable
- Direct Known Subclasses:
CustomScreen
,DefaultScreen
Represents a screen that can be displayed to the user.
This class is not legal for implementation!
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull AbstractScreen
fromByteArray
(byte[] bytes) Deserializes a screen from a byte array.Gets the JSON message that represents the narration of this element.Gets the title of this screen.final byte[]
Serializes this screen to a byte array.
-
Constructor Details
-
AbstractScreen
protected AbstractScreen()Constructs a new screen.
-
-
Method Details
-
getTitleJSON
Gets the title of this screen.- Returns:
- Title in JSON Format
-
getNarrationMessageJSON
Description copied from interface:Narratable
Gets the JSON message that represents the narration of this element. By default, this is the title of the element.- Specified by:
getNarrationMessageJSON
in interfaceNarratable
- Returns:
- the JSON message
-
toByteArray
public final byte[] toByteArray()Serializes this screen to a byte array.- Returns:
- Byte Array
-
fromByteArray
Deserializes a screen from a byte array.- Parameters:
bytes
- Byte Array- Returns:
- Deserialized Screem
-