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 class
Builder class for creatingSearchHistoryEntry
instances. -
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.Builder
builder()
Creates a new builder instance.boolean
Returns the value of thecaseSensitive
record component.date()
Returns the value of thedate
record component.boolean
Indicates whether some other object is "equal to" this one.boolean
equalsExceptDate
(Object obj) getParameter
(String key) Gets the value of a specific parameter.final int
hashCode()
Returns a hash code value for this object.boolean
hasParameter
(String key) Checks if a parameter exists.Returns the value of theparameters
record component.Returns the value of thequeryText
record component.Returns the value of thequeryType
record component.Creates a new builder initialized with this entry's values.final String
toString()
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 thecompare
method from their corresponding wrapper classes. -
equalsExceptDate
-
toString
-
hashCode
-
date
Returns the value of thedate
record component.- Returns:
- the value of the
date
record component
-
queryText
Returns the value of thequeryText
record component.- Returns:
- the value of the
queryText
record component
-
queryType
Returns the value of thequeryType
record component.- Returns:
- the value of the
queryType
record component
-
caseSensitive
public boolean caseSensitive()Returns the value of thecaseSensitive
record component.- Returns:
- the value of the
caseSensitive
record component
-
parameters
-