Skip to content

Commit 24fabf2

Browse files
committed
Improve javadoc and add @ApiStatus annotations
1 parent d80828e commit 24fabf2

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎src/main/java/org/glavo/nbt/tag/Tag.java‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import org.glavo.nbt.NBTParent;
2020
import org.glavo.nbt.internal.input.DataReader;
2121
import org.glavo.nbt.internal.output.DataWriter;
22+
import org.jetbrains.annotations.ApiStatus;
2223
import org.jetbrains.annotations.Contract;
2324
import org.jetbrains.annotations.Nullable;
2425

@@ -64,6 +65,8 @@ protected Tag(String name) {
6465
}
6566

6667
/// Returns the type of the tag.
68+
///
69+
/// @see TagType
6770
@Contract(pure = true)
6871
public abstract TagType<?> getType();
6972

@@ -113,6 +116,8 @@ void setIndex(int index) {
113116
}
114117

115118
/// If the tag is a child of a [parent tag][ParentTag], returns the parent tag; otherwise, returns `null`.
119+
///
120+
/// @see ParentTag
116121
@Contract(pure = true)
117122
public @Nullable ParentTag<?> getParentTag() {
118123
return parent instanceof ParentTag<?> parentTag ? parentTag : null;
@@ -121,6 +126,8 @@ void setIndex(int index) {
121126
/// Sets the parent of this tag.
122127
///
123128
/// Internal method, should only be called by [ParentTag] or [org.glavo.nbt.chunk.Chunk] when adding or removing subtags.
129+
///
130+
/// @see ParentTag
124131
@Contract(mutates = "this")
125132
void setParent(@Nullable NBTParent<? extends Tag> parent, int index) {
126133
assert parent == null ^ index >= 0;
@@ -129,9 +136,11 @@ void setParent(@Nullable NBTParent<? extends Tag> parent, int index) {
129136
}
130137

131138
/// Internal method for reading the content of the tag.
139+
@ApiStatus.Internal
132140
protected abstract void readContent(DataReader reader) throws IOException;
133141

134142
/// Internal method for writing the content of the tag.
143+
@ApiStatus.Internal
135144
protected abstract void writeContent(DataWriter writer) throws IOException;
136145

137146
protected abstract void contentToString(StringBuilder builder);

0 commit comments

Comments
 (0)