2020-04-24 03:25:58 +02:00
|
|
|
package net.minestom.server.data;
|
2019-08-23 23:55:09 +02:00
|
|
|
|
2020-09-05 16:45:33 +02:00
|
|
|
/**
|
2020-10-12 02:56:30 +02:00
|
|
|
* Represents an element which can have a {@link Data} attached to it.
|
|
|
|
* <p>
|
|
|
|
* The data will always be optional.
|
2020-09-05 16:45:33 +02:00
|
|
|
*/
|
2019-08-23 23:55:09 +02:00
|
|
|
public interface DataContainer {
|
|
|
|
|
2020-08-03 00:37:03 +02:00
|
|
|
/**
|
2020-10-12 02:56:30 +02:00
|
|
|
* Get the {@link Data} of this container.
|
|
|
|
* <p>
|
|
|
|
* A {@link DataContainer} data is always optional,
|
|
|
|
* meaning that this will be null if no data has been defined.
|
2020-08-03 00:37:03 +02:00
|
|
|
*
|
2020-09-05 16:45:33 +02:00
|
|
|
* @return the {@link Data} of this container, can be null
|
2020-08-03 00:37:03 +02:00
|
|
|
*/
|
2019-08-23 23:55:09 +02:00
|
|
|
Data getData();
|
|
|
|
|
2020-08-03 00:37:03 +02:00
|
|
|
/**
|
2020-10-12 02:56:30 +02:00
|
|
|
* Set the {@link Data} of this container.
|
2020-08-03 00:37:03 +02:00
|
|
|
*
|
2020-09-05 16:45:33 +02:00
|
|
|
* @param data the {@link Data} of this container, null to remove it
|
2020-08-03 00:37:03 +02:00
|
|
|
*/
|
2019-08-23 23:55:09 +02:00
|
|
|
void setData(Data data);
|
|
|
|
|
|
|
|
}
|