Record Class WrittenBookPredicate
java.lang.Object
java.lang.Record
net.minecraft.core.component.predicates.WrittenBookPredicate
- All Implemented Interfaces:
SingleComponentItemPredicate<WrittenBookContent>, DataComponentPredicate
public record WrittenBookPredicate(Optional<CollectionPredicate<Filterable<Component>, WrittenBookPredicate.PagePredicate>> pages, Optional<String> author, Optional<String> title, MinMaxBounds.Ints generation, Optional<Boolean> resolved)
extends Record
implements SingleComponentItemPredicate<WrittenBookContent>
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface DataComponentPredicate
DataComponentPredicate.AnyValueType, DataComponentPredicate.ConcreteType<T>, DataComponentPredicate.Single<T>, DataComponentPredicate.Type<T>, DataComponentPredicate.TypeBase<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for theauthorrecord component.static final com.mojang.serialization.Codec<WrittenBookPredicate> private final MinMaxBounds.IntsThe field for thegenerationrecord component.private final Optional<CollectionPredicate<Filterable<Component>, WrittenBookPredicate.PagePredicate>> The field for thepagesrecord component.The field for theresolvedrecord component.The field for thetitlerecord component.Fields inherited from interface DataComponentPredicate
SINGLE_STREAM_CODEC, STREAM_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionWrittenBookPredicate(Optional<CollectionPredicate<Filterable<Component>, WrittenBookPredicate.PagePredicate>> pages, Optional<String> author, Optional<String> title, MinMaxBounds.Ints generation, Optional<Boolean> resolved) Creates an instance of aWrittenBookPredicaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionauthor()Returns the value of theauthorrecord component.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.booleanmatches(WrittenBookContent value) pages()Returns the value of thepagesrecord component.resolved()Returns the value of theresolvedrecord component.title()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface SingleComponentItemPredicate
matches
-
Field Details
-
pages
private final Optional<CollectionPredicate<Filterable<Component>, WrittenBookPredicate.PagePredicate>> pagesThe field for thepagesrecord component. -
author
-
title
-
generation
The field for thegenerationrecord component. -
resolved
-
CODEC
-
-
Constructor Details
-
WrittenBookPredicate
public WrittenBookPredicate(Optional<CollectionPredicate<Filterable<Component>, WrittenBookPredicate.PagePredicate>> pages, Optional<String> author, Optional<String> title, MinMaxBounds.Ints generation, Optional<Boolean> resolved) Creates an instance of aWrittenBookPredicaterecord 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
-
componentType
- Specified by:
componentTypein interfaceSingleComponentItemPredicate<WrittenBookContent>
-
matches
- Specified by:
matchesin interfaceSingleComponentItemPredicate<WrittenBookContent>
-
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
public Optional<CollectionPredicate<Filterable<Component>, WrittenBookPredicate.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
-