Record Class SearchIndexEntry
java.lang.Object
java.lang.Record
com.puppycrawl.tools.checkstyle.site.SearchIndexEntry
- Record Components:
title- display nameurl- relative URLcategory- category labeltype- document typedescription- short descriptionkeywords- comma-separated keywords
public record SearchIndexEntry(String title, String url, String category, String type, String description, String keywords)
extends Record
Represents a single entry in the client-side search index.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intMaximum ASCII value for the lookup table.private final StringThe field for thecategoryrecord component.private static final StringString literal for comma.private final StringThe field for thedescriptionrecord component.private static final String[]Lookup table for JSON escape sequences for characters < 128 (ASCII range).private final StringThe field for thekeywordsrecord component.private final StringThe field for thetitlerecord component.private final StringThe field for thetyperecord component.private final StringThe field for theurlrecord component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncategory()Returns the value of thecategoryrecord component.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.private static StringjsonString(String value) Wraps a string value in JSON double quotes and escapes special characters.keywords()Returns the value of thekeywordsrecord component.title()Returns the value of thetitlerecord component.toJson()Serialises this entry to a compact JSON object string.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.url()Returns the value of theurlrecord component.
-
Field Details
-
title
The field for thetitlerecord component. -
url
The field for theurlrecord component. -
category
The field for thecategoryrecord component. -
type
The field for thetyperecord component. -
description
The field for thedescriptionrecord component. -
keywords
The field for thekeywordsrecord component. -
COMMA
String literal for comma.- See Also:
-
ASCII_MAX
Maximum ASCII value for the lookup table.- See Also:
-
JSON_ESCAPES
Lookup table for JSON escape sequences for characters < 128 (ASCII range).
-
-
Constructor Details
-
SearchIndexEntry
public SearchIndexEntry(String title, String url, String category, String type, String description, String keywords) Creates an instance of aSearchIndexEntryrecord class.- Parameters:
title- the value for thetitlerecord componenturl- the value for theurlrecord componentcategory- the value for thecategoryrecord componenttype- the value for thetyperecord componentdescription- the value for thedescriptionrecord componentkeywords- the value for thekeywordsrecord component
-
-
Method Details
-
toJson
Serialises this entry to a compact JSON object string.- Returns:
- JSON object string
-
jsonString
Wraps a string value in JSON double quotes and escapes special characters.- Parameters:
value- the raw string to encode- Returns:
- JSON-safe quoted string, or
""if value is null
-
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
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). -
title
Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-
url
Returns the value of theurlrecord component.- Returns:
- the value of the
urlrecord component
-
category
Returns the value of thecategoryrecord component.- Returns:
- the value of the
categoryrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
keywords
Returns the value of thekeywordsrecord component.- Returns:
- the value of the
keywordsrecord component
-