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
ConstructorDescriptionSearchListEntry
(T value, String category, boolean showCategory, boolean drawSeparator) Creates an instance of aSearchListEntry
record class. -
Method Summary
Modifier and TypeMethodDescriptioncategory()
Returns the value of thecategory
record component.boolean
Returns the value of thedrawSeparator
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
Returns the value of theshowCategory
record component.final String
toString()
Returns a string representation of this record class.value()
Returns the value of thevalue
record component.
-
Constructor Details
-
SearchListEntry
Creates an instance of aSearchListEntry
record class.- Parameters:
value
- the value for thevalue
record componentcategory
- the value for thecategory
record componentshowCategory
- the value for theshowCategory
record componentdrawSeparator
- the value for thedrawSeparator
record 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 thevalue
record component.- Returns:
- the value of the
value
record component
-
category
Returns the value of thecategory
record component.- Returns:
- the value of the
category
record component
-
showCategory
public boolean showCategory()Returns the value of theshowCategory
record component.- Returns:
- the value of the
showCategory
record component
-
drawSeparator
public boolean drawSeparator()Returns the value of thedrawSeparator
record component.- Returns:
- the value of the
drawSeparator
record component
-