Package net.mezzdev.config.api.sorting
Interface ISortingSnapshot<T>
- Type Parameters:
T- effectively immutable value type with stable equality and hash codes
@NonExtendable
public interface ISortingSnapshot<T>
An immutable view of the visible values and ordering resolved from a sorting config.
Config edits and changes to the available values do not update this snapshot. Obtain a new snapshot from
ISortingConfig.getSnapshot(java.util.Collection<T>) after either changes. Snapshots may be shared between threads, provided the values
and the config's default comparator are safe to share.
- Since:
- 0.6.10
-
Method Summary
Modifier and TypeMethodDescriptionReturn a comparator using this snapshot's order.Return the duplicate-free visible values in their resolved order.booleanReturn whether a value is visible in this snapshot, using value equality.
-
Method Details
-
getSortedValues
Return the duplicate-free visible values in their resolved order.- Returns:
- an unmodifiable list of visible values
- Since:
- 0.6.10
-
isVisible
Return whether a value is visible in this snapshot, using value equality.- Parameters:
value- value to check- Returns:
- false for hidden values and values absent when the snapshot was created
- Since:
- 0.6.10
-
getComparator
Comparator<T> getComparator()Return a comparator using this snapshot's order. Visible values sort first in their resolved order. All other values, including hidden values, sort afterward using the config's default comparator.- Returns:
- a comparator independent of subsequent config edits
- Since:
- 0.6.10
-