Record Class DataComponentPredicate.WrittenBook
java.lang.Object
java.lang.Record
net.minestom.server.instance.block.predicate.DataComponentPredicate.WrittenBook
- Record Components:
pages- Predicates to match against the book's pages, or null to ignore- The expected author, or null to ignoretitle- The expected title, or null to ignoregeneration- The expected generation, or null to ignoreresolved- The expected value ofWrittenBookContent.resolved(), or null to ignore
- All Implemented Interfaces:
Predicate<DataComponent.Holder>, DataComponentPredicate, DataComponentPredicate.Registered
- Enclosing interface:
DataComponentPredicate
public static record DataComponentPredicate.WrittenBook(@Nullable CollectionPredicate<FilteredText<Component>, DataComponentPredicate.WrittenBook.PagePredicate> pages, @Nullable String author, @Nullable String title, Range.Int generation, @Nullable Boolean resolved)
extends Record
implements DataComponentPredicate.Registered
Tests the content of pages in the
DataComponents.WRITTEN_BOOK_CONTENT component.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordNested classes/interfaces inherited from interface DataComponentPredicate
DataComponentPredicate.ArmorTrim, DataComponentPredicate.AttributeModifierPredicate, DataComponentPredicate.AttributeModifiers, DataComponentPredicate.BundleContents, DataComponentPredicate.Container, DataComponentPredicate.CustomData, DataComponentPredicate.Damage, DataComponentPredicate.EnchantmentListPredicate, DataComponentPredicate.Enchantments, DataComponentPredicate.Exists, DataComponentPredicate.FireworkExplosion, DataComponentPredicate.FireworkExplosionPredicate, DataComponentPredicate.Fireworks, DataComponentPredicate.JukeboxPlayable, DataComponentPredicate.Potions, DataComponentPredicate.Registered, DataComponentPredicate.StoredEnchantments, DataComponentPredicate.VillagerVariant, DataComponentPredicate.WritableBook, DataComponentPredicate.WrittenBook -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWrittenBook(@Nullable CollectionPredicate<FilteredText<Component>, DataComponentPredicate.WrittenBook.PagePredicate> pages, @Nullable String author, @Nullable String title, Range.Int generation, @Nullable Boolean resolved) Creates an instance of aWrittenBookrecord class. -
Method Summary
Modifier and TypeMethodDescriptionauthor()Returns the value of theauthorrecord component.codec()Returns the codec registered for this predicate type.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thegenerationrecord component.final inthashCode()Returns a hash code value for this object.@Nullable CollectionPredicate<FilteredText<Component>, DataComponentPredicate.WrittenBook.PagePredicate> pages()Returns the value of thepagesrecord component.resolved()Returns the value of theresolvedrecord component.booleantest(DataComponent.Holder holder) title()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
-
Constructor Details
-
WrittenBook
public WrittenBook(@Nullable @Nullable CollectionPredicate<FilteredText<Component>, DataComponentPredicate.WrittenBook.PagePredicate> pages, @Nullable @Nullable String author, @Nullable @Nullable String title, @Nullable Range.Int generation, @Nullable @Nullable Boolean resolved) Creates an instance of aWrittenBookrecord class.- Parameters:
pages- the value for thepagesrecord componentauthor- the value for theauthorrecord componenttitle- the value for thetitlerecord componentgeneration- the value for thegenerationrecord componentresolved- the value for theresolvedrecord component
-
-
Method Details
-
test
- Specified by:
testin interfacePredicate<DataComponent.Holder>
-
codec
Description copied from interface:DataComponentPredicate.RegisteredReturns the codec registered for this predicate type.- Specified by:
codecin interfaceDataComponentPredicate.Registered- Returns:
- the predicate codec
-
toString
-
hashCode
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
pages
@Nullable public @Nullable CollectionPredicate<FilteredText<Component>, DataComponentPredicate.WrittenBook.PagePredicate> pages()Returns the value of thepagesrecord component.- Returns:
- the value of the
pagesrecord component
-
author
-
title
-
generation
Returns the value of thegenerationrecord component.- Returns:
- the value of the
generationrecord component
-
resolved
-