Record Class WrittenBookContent
java.lang.Object
java.lang.Record
net.minestom.server.item.component.WrittenBookContent
public record WrittenBookContent(@NotNull FilteredText<String> title, @NotNull String author, int generation, @NotNull List<FilteredText<Component>> pages, boolean resolved)
extends Record
-
Field Summary
Modifier and TypeFieldDescriptionstatic final WrittenBookContent
static final @NotNull BinaryTagSerializer
<WrittenBookContent> static final NetworkBuffer.Type
<WrittenBookContent> -
Constructor Summary
ConstructorDescriptionWrittenBookContent
(@NotNull String title, @NotNull String author, int generation, @NotNull List<Component> pages, boolean resolved) WrittenBookContent
(@NotNull String title, @NotNull String author, @NotNull List<Component> pages) WrittenBookContent
(@NotNull FilteredText<String> title, @NotNull String author, int generation, @NotNull List<FilteredText<Component>> pages, boolean resolved) Creates an instance of aWrittenBookContent
record class. -
Method Summary
Modifier and TypeMethodDescription@NotNull String
author()
Returns the value of theauthor
record component.final boolean
Indicates whether some other object is "equal to" this one.int
Returns the value of thegeneration
record component.final int
hashCode()
Returns a hash code value for this object.@NotNull List
<FilteredText<Component>> pages()
Returns the value of thepages
record component.boolean
resolved()
Returns the value of theresolved
record component.@NotNull FilteredText
<String> title()
Returns the value of thetitle
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
EMPTY
-
NETWORK_TYPE
-
NBT_TYPE
-
-
Constructor Details
-
WrittenBookContent
public WrittenBookContent(@NotNull @NotNull FilteredText<String> title, @NotNull @NotNull String author, int generation, @NotNull @NotNull List<FilteredText<Component>> pages, boolean resolved) Creates an instance of aWrittenBookContent
record class.- Parameters:
title
- the value for thetitle
record componentauthor
- the value for theauthor
record componentgeneration
- the value for thegeneration
record componentpages
- the value for thepages
record componentresolved
- the value for theresolved
record component
-
WrittenBookContent
-
WrittenBookContent
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
title
Returns the value of thetitle
record component.- Returns:
- the value of the
title
record component
-
author
Returns the value of theauthor
record component.- Returns:
- the value of the
author
record component
-
generation
public int generation()Returns the value of thegeneration
record component.- Returns:
- the value of the
generation
record component
-
pages
Returns the value of thepages
record component.- Returns:
- the value of the
pages
record component
-
resolved
public boolean resolved()Returns the value of theresolved
record component.- Returns:
- the value of the
resolved
record component
-