More doc to TagHandler

Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
TheMode 2022-05-02 13:34:05 +02:00
parent ef53559349
commit 68fc705cd3

View File

@ -10,12 +10,40 @@ import org.jglrxavpok.hephaistos.nbt.NBTCompoundLike;
*/
public interface TagHandler extends TagReadable, TagWritable {
/**
* Creates a readable copy of this handler.
* <p>
* Similar to {@link #asCompound()} with the advantage that cached objects
* and adaptive optimizations may be reused.
*
* @return a copy of this handler
*/
@NotNull TagReadable readableCopy();
/**
* Creates a copy of this handler.
* <p>
* Similar to {@link #fromCompound(NBTCompoundLike)} using {@link #asCompound()}
* with the advantage that cached objects and adaptive optimizations may be reused.
*
* @return a copy of this handler
*/
@NotNull TagHandler copy();
/**
* Updates the content of this handler.
* <p>
* Can be used as a clearing method with {@link NBTCompound#EMPTY}.
*
* @param compound the new content of this handler
*/
void updateContent(@NotNull NBTCompoundLike compound);
/**
* Converts the content of this handler into a {@link NBTCompound}.
*
* @return a nbt compound representation of this handler
*/
@NotNull NBTCompound asCompound();
@ApiStatus.Experimental