Class EntrantEventFilterUtils

java.lang.Object
com.example.lottery.util.EntrantEventFilterUtils

public final class EntrantEventFilterUtils extends Object
Pure filter predicates for the entrant Explore event list. Extracted from EntrantMainActivity so the filtering rules can be unit tested without launching an Activity.
  • Field Details

  • Method Details

    • matchesSearchQuery

      public static boolean matchesSearchQuery(Event event, String rawQuery)
      Case-insensitive substring match of the event title against the query.
    • matchesCategory

      public static boolean matchesCategory(Event event, String category)
      True if the event category matches the selected filter.
    • matchesTimeFilter

      public static boolean matchesTimeFilter(Event event, String timeFilter, Date now)
      True if the event's scheduled time falls within the selected time window.
    • hasAvailableSpots

      public static boolean hasAvailableSpots(Event event, Map<String,Integer> waitlistCounts, Date now)
      True if the event has room on its waiting list and registration is still open.
    • isNewEvent

      public static boolean isNewEvent(Event event, Date now)
      True if the event was created within the last seven days.
    • isRecommendedEvent

      public static boolean isRecommendedEvent(Event event, List<String> interests)
      True if the event's category matches any stored user interest.
    • matchesBrowseTab

      public static boolean matchesBrowseTab(Event event, String browseTab, Date now, List<String> interests)
      Dispatches to the predicate for the selected browse tab.