Record Class WrittenBook
java.lang.Object
java.lang.Record
com.viaversion.viaversion.api.minecraft.item.data.WrittenBook
- All Implemented Interfaces:
Copyable
public record WrittenBook(FilterableString title, String author, int generation, FilterableComponent[] pages, boolean resolved)
extends Record
implements Copyable
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWrittenBook(FilterableString title, String author, int generation, FilterableComponent[] pages, boolean resolved) Creates an instance of aWrittenBookrecord class. -
Method Summary
Modifier and TypeMethodDescriptionauthor()Returns the value of theauthorrecord component.copy()final booleanIndicates whether some other object is "equal to" this one.intReturns the value of thegenerationrecord component.final inthashCode()Returns a hash code value for this object.pages()Returns the value of thepagesrecord component.booleanresolved()Returns the value of theresolvedrecord component.title()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
TYPE
-
-
Constructor Details
-
WrittenBook
public WrittenBook(FilterableString title, String author, int generation, FilterableComponent[] pages, boolean resolved) Creates an instance of aWrittenBookrecord class.- Parameters:
title- the value for thetitlerecord componentauthor- the value for theauthorrecord componentgeneration- the value for thegenerationrecord componentpages- the value for thepagesrecord componentresolved- the value for theresolvedrecord component
-
-
Method Details
-
copy
-
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 thetitlerecord component.- Returns:
- the value of the
titlerecord component
-
author
Returns the value of theauthorrecord component.- Returns:
- the value of the
authorrecord component
-
generation
public int generation()Returns the value of thegenerationrecord component.- Returns:
- the value of the
generationrecord component
-
pages
Returns the value of thepagesrecord component.- Returns:
- the value of the
pagesrecord component
-
resolved
public boolean resolved()Returns the value of theresolvedrecord component.- Returns:
- the value of the
resolvedrecord component
-