Package xyz.gmitch215.socketmc.util
Interface DataHolder
- All Known Implementing Classes:
DefaultScreen
,RenderInstruction
,RenderInstruction.DebugRenderer
,RenderInstruction.GameRenderer
public interface DataHolder
Represents an object that holds an immutable map of data.
-
Method Summary
Modifier and TypeMethodDescriptionGets a specific piece of data from this object.default <T> T
Gets a specific piece of data from this object.default <T> T
Gets a specific piece of data from this object.Gets a specific piece of data from this object.getData()
Gets an immutable copy for the data for this object.
-
Method Details
-
getData
Gets an immutable copy for the data for this object.- Returns:
- Screen Data
-
data
@Nullable default @Nullable Object data(@NotNull @NotNull String key) throws IllegalArgumentException Gets a specific piece of data from this object.- Parameters:
key
- Data Key- Returns:
- Data Value
- Throws:
IllegalArgumentException
- if key is null
-
data
@NotNull default @NotNull Object data(@NotNull @NotNull String key, @NotNull @NotNull Object def) throws IllegalArgumentException Gets a specific piece of data from this object.- Parameters:
key
- Data Keydef
- Default Value- Returns:
- Data Value
- Throws:
IllegalArgumentException
- if key or default value are null
-
data
@Nullable default <T> T data(@NotNull @NotNull String key, @NotNull @NotNull Class<T> clazz) throws IllegalArgumentException Gets a specific piece of data from this object.- Type Parameters:
T
- Data Type- Parameters:
key
- Data Keyclazz
- Data Class- Returns:
- Data Value
- Throws:
IllegalArgumentException
- if key or class are null
-
data
@NotNull default <T> T data(@NotNull @NotNull String key, @NotNull @NotNull Class<T> clazz, @NotNull T def) throws IllegalArgumentException Gets a specific piece of data from this object.- Type Parameters:
T
- Data Type- Parameters:
key
- Data Keyclazz
- Data Classdef
- Default Value- Returns:
- Data Value
- Throws:
IllegalArgumentException
- if key, class, or default value are null
-