Class SymbolRegistryUtil

java.lang.Object
com.bluebell.greenhouse.platform.util.registry.SymbolRegistryUtil

public final class SymbolRegistryUtil extends Object
Utility methods for filtering and sorting symbol registry collections.
Version:
1.0.9
Author:
Stephen Prizio
  • Method Details

    • matchesFilter

      public static boolean matchesFilter(SymbolRegistryEntry entry, SymbolRegistryEntryFilter filter)
      Returns true when the given entry matches the supplied filter.
      Parameters:
      entry - entry
      filter - optional filter
      Returns:
      true when the entry matches
    • getEntryComparator

      public static Comparator<SymbolRegistryEntry> getEntryComparator(SymbolRegistryEntrySortField sortField, org.springframework.data.domain.Sort.Direction direction)
      Returns the comparator for the given sort request.
      Parameters:
      sortField - optional sort field
      direction - optional sort direction
      Returns:
      Comparator of SymbolRegistryEntry
    • getDefaultEntryComparator

      public static Comparator<SymbolRegistryEntry> getDefaultEntryComparator()
      Returns the default comparator used when no explicit sort is requested.
      Returns:
      Comparator of SymbolRegistryEntry
    • getStringComparator

      public static Comparator<SymbolRegistryEntry> getStringComparator(Function<SymbolRegistryEntry, String> extractor, org.springframework.data.domain.Sort.Direction direction)
      Returns a comparator for a text field.
      Parameters:
      extractor - string extractor
      direction - sort direction
      Returns:
      Comparator of SymbolRegistryEntry
    • getConfidenceComparator

      public static Comparator<SymbolRegistryEntry> getConfidenceComparator(org.springframework.data.domain.Sort.Direction direction)
      Returns a comparator for confidence values.
      Parameters:
      direction - sort direction
      Returns:
      Comparator of SymbolRegistryEntry
    • matchesTextFilter

      public static boolean matchesTextFilter(String filterValue, String actualValue)
      Returns true when a text field matches a text filter.
      Parameters:
      filterValue - filter value
      actualValue - actual value
      Returns:
      true when the filter matches
    • matchesBooleanFilter

      public static boolean matchesBooleanFilter(Boolean filterValue, boolean actualValue)
      Returns true when a boolean field matches a boolean filter.
      Parameters:
      filterValue - filter value
      actualValue - actual value
      Returns:
      true when the filter matches
    • matchesSourceUrlFilter

      public static boolean matchesSourceUrlFilter(String filterValue, List<String> sourceUrls)
      Returns true when a source URL filter matches any source URL on an entry.
      Parameters:
      filterValue - filter value
      sourceUrls - source URLs
      Returns:
      true when the filter matches
    • matchesConfidenceFilter

      public static boolean matchesConfidenceFilter(Double confidence, Double confidenceMin, Double confidenceMax)
      Returns true when an entry confidence matches the configured range.
      Parameters:
      confidence - confidence
      confidenceMin - optional minimum confidence
      confidenceMax - optional maximum confidence
      Returns:
      true when the confidence matches