Package mekhq.campaign.roleplay
Record Class JournalFilter
java.lang.Object
java.lang.Record
mekhq.campaign.roleplay.JournalFilter
- Record Components:
text- text the entry must contain, ignoring case and formattingfrom- the earliest date to includeto- the latest date to includetypes- the types of entry to include; empty includes every typethread- the id of a plot thread the entry must be tagged withcharacter- the id of an Oracle character the entry must be tagged with
public record JournalFilter(String text, LocalDate from, LocalDate to, Set<JournalEntryType> types, UUID thread, UUID character)
extends Record
Criteria for narrowing the journal. Every criterion is optional: a
null (or blank search text) matches
everything.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJournalFilter(String text, LocalDate from, LocalDate to, Set<JournalEntryType> types, UUID thread, UUID character) Creates an instance of aJournalFilterrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecharacterrecord component.final booleanIndicates whether some other object is "equal to" this one.from()Returns the value of thefromrecord component.final inthashCode()Returns a hash code value for this object.booleanisActive()booleanmatches(JournalEntry entry) text()Returns the value of thetextrecord component.thread()Returns the value of thethreadrecord component.to()Returns the value of thetorecord component.final StringtoString()Returns a string representation of this record class.types()Returns the value of thetypesrecord component.
-
Field Details
-
ALL
A filter that matches every entry.
-
-
Constructor Details
-
JournalFilter
public JournalFilter(@Nullable String text, @Nullable LocalDate from, @Nullable LocalDate to, Set<JournalEntryType> types, @Nullable UUID thread, @Nullable UUID character) Creates an instance of aJournalFilterrecord class.- Parameters:
text- the value for thetextrecord componentfrom- the value for thefromrecord componentto- the value for thetorecord componenttypes- the value for thetypesrecord componentthread- the value for thethreadrecord componentcharacter- the value for thecharacterrecord component
-
-
Method Details
-
matches
- Parameters:
entry- a journal entry- Returns:
trueif the entry meets every criterion
-
isActive
public boolean isActive()- Returns:
trueif this filter narrows anything
-
withText
- Parameters:
newText- the search text- Returns:
- a copy of this filter with different search text
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
text
Returns the value of thetextrecord component.- Returns:
- the value of the
textrecord component
-
from
Returns the value of thefromrecord component.- Returns:
- the value of the
fromrecord component
-
to
Returns the value of thetorecord component.- Returns:
- the value of the
torecord component
-
types
Returns the value of thetypesrecord component.- Returns:
- the value of the
typesrecord component
-
thread
Returns the value of thethreadrecord component.- Returns:
- the value of the
threadrecord component
-
character
Returns the value of thecharacterrecord component.- Returns:
- the value of the
characterrecord component
-