Record Class SearchHistoryEntry
java.lang.Object
java.lang.Record
ca.phon.util.SearchHistoryEntry
- All Implemented Interfaces:
Serializable
public record SearchHistoryEntry(LocalDateTime date, String queryText, SearchType queryType, boolean caseSensitive, Map<String,String> parameters)
extends Record
implements Serializable
Represents a single search history entry with comprehensive metadata. Each entry contains the search query, type, search options, and timestamp information needed for advanced search history management.
This record is immutable to ensure thread safety and data integrity.
Use the SearchHistoryEntry.Builder to create new instances or modify existing ones.
Usage example:
SearchHistoryEntry entry = SearchHistoryEntry.builder()
.queryText("phoneme transcription")
.queryType("phonex")
.caseSensitive(false)
.parameter("target", "IPA Target")
.parameter("group", "Word")
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder class for creatingSearchHistoryEntryinstances. -
Constructor Summary
ConstructorsConstructorDescriptionSearchHistoryEntry(LocalDateTime date, String queryText, SearchType queryType, boolean caseSensitive, Map<String, String> parameters) Compact constructor with validation and defensive copying. -
Method Summary
Modifier and TypeMethodDescriptionstatic SearchHistoryEntry.Builderbuilder()Creates a new builder instance.booleanReturns the value of thecaseSensitiverecord component.date()Returns the value of thedaterecord component.booleanIndicates whether some other object is "equal to" this one.booleanequalsExceptDate(Object obj) getParameter(String key) Gets the value of a specific parameter.final inthashCode()Returns a hash code value for this object.booleanhasParameter(String key) Checks if a parameter exists.Returns the value of theparametersrecord component.Returns the value of thequeryTextrecord component.Returns the value of thequeryTyperecord component.Creates a new builder initialized with this entry's values.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SearchHistoryEntry
public SearchHistoryEntry(LocalDateTime date, String queryText, SearchType queryType, boolean caseSensitive, Map<String, String> parameters) Compact constructor with validation and defensive copying.
-
-
Method Details
-
getParameter
-
hasParameter
Checks if a parameter exists.- Parameters:
key- the parameter key- Returns:
- true if the parameter exists
-
builder
Creates a new builder instance.- Returns:
- a new builder
-
toBuilder
Creates a new builder initialized with this entry's values.- Returns:
- a new builder with this entry's values
-
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 thecomparemethod from their corresponding wrapper classes. -
equalsExceptDate
-
toString
-
hashCode
-
date
Returns the value of thedaterecord component.- Returns:
- the value of the
daterecord component
-
queryText
Returns the value of thequeryTextrecord component.- Returns:
- the value of the
queryTextrecord component
-
queryType
Returns the value of thequeryTyperecord component.- Returns:
- the value of the
queryTyperecord component
-
caseSensitive
public boolean caseSensitive()Returns the value of thecaseSensitiverecord component.- Returns:
- the value of the
caseSensitiverecord component
-
parameters
-