Package docking.widgets.searchlist
Record Class SearchListEntry<T>
java.lang.Object
java.lang.Record
docking.widgets.searchlist.SearchListEntry<T>
- Type Parameters:
T- the type of list items- Record Components:
value- the list item (T)category- the category for the itemshowCategory- true if this is the first item in the category and therefor the category should be displayed.drawSeparator- if true, then a separator line should be drawn after this entry. This should only be the case for the last entry in a category (and not the last category.)
public record SearchListEntry<T>(T value, String category, boolean showCategory, boolean drawSeparator)
extends Record
An record to hold the list item and additional information needed to properly render the item.
-
Constructor Summary
ConstructorsConstructorDescriptionSearchListEntry(T value, String category, boolean showCategory, boolean drawSeparator) Creates an instance of aSearchListEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncategory()Returns the value of thecategoryrecord component.booleanReturns the value of thedrawSeparatorrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theshowCategoryrecord component.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
SearchListEntry
Creates an instance of aSearchListEntryrecord class.- Parameters:
value- the value for thevaluerecord componentcategory- the value for thecategoryrecord componentshowCategory- the value for theshowCategoryrecord componentdrawSeparator- the value for thedrawSeparatorrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
category
Returns the value of thecategoryrecord component.- Returns:
- the value of the
categoryrecord component
-
showCategory
public boolean showCategory()Returns the value of theshowCategoryrecord component.- Returns:
- the value of the
showCategoryrecord component
-
drawSeparator
public boolean drawSeparator()Returns the value of thedrawSeparatorrecord component.- Returns:
- the value of the
drawSeparatorrecord component
-