Minestom/src/main/java/net/minestom/server/data/DataContainer.java

39 lines
1.1 KiB
Java
Raw Normal View History

2020-04-24 03:25:58 +02:00
package net.minestom.server.data;
2020-10-24 10:46:23 +02:00
import org.jetbrains.annotations.Nullable;
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>
2020-10-26 01:30:32 +01:00
* The data will always be optional and can therefore be null.
*
* @deprecated switch to the Tag API instead
2020-09-05 16:45:33 +02:00
*/
@Deprecated
public interface DataContainer {
2020-08-03 00:37:03 +02:00
/**
2020-10-15 21:16:31 +02:00
* Gets the {@link Data} of this container.
2020-10-12 02:56:30 +02:00
* <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
2021-08-24 11:33:02 +02:00
* @deprecated use the tag API https://wiki.minestom.net/feature/tags
2020-08-03 00:37:03 +02:00
*/
2021-06-26 00:31:04 +02:00
@Deprecated
@Nullable Data getData();
2020-08-03 00:37:03 +02:00
/**
2020-10-15 21:16:31 +02:00
* Sets the {@link Data} of this container.
2020-10-26 01:30:32 +01:00
* <p>
* Default implementations are {@link DataImpl} and {@link SerializableDataImpl} depending
* on your use-case.
2020-08-03 00:37:03 +02:00
*
* @param data the new {@link Data} of this container, null to remove it
2021-08-24 11:33:02 +02:00
* @deprecated use the tag API https://wiki.minestom.net/feature/tags
2020-08-03 00:37:03 +02:00
*/
2021-06-26 00:31:04 +02:00
@Deprecated
2020-10-24 10:46:23 +02:00
void setData(@Nullable Data data);
2021-08-24 11:33:02 +02:00
}