Class Util

java.lang.Object
ch.poole.openinghoursparser.Util

public final class Util extends Object
  • Method Details

    • getMergeableRules

      public static List<List<Rule>> getMergeableRules(List<Rule> rules)
      find rules that only differs in the days and times objects and can be merged for display puposes
      Parameters:
      rules - rules to check
      Returns:
      list of list of rules that can be merged
    • rulesToOpeningHoursString

      public static String rulesToOpeningHoursString(@NotNull @NotNull List<Rule> rules)
      Generate an OH string from rules
      Parameters:
      rules - rules to convert to an opening_hours string
      Returns:
      specification conformant opening_hours string
    • rulesToOpeningHoursDebugString

      public static String rulesToOpeningHoursDebugString(@NotNull @NotNull List<Rule> rules)
      Generate a debugging output string from rules
      Parameters:
      rules - rules to convert to an opening_hours string
      Returns:
      specification debugging opening_hours string
    • capitalize

      public static String capitalize(String s)
      Capitalize a string
      Parameters:
      s - string to capitalize
      Returns:
      capitalized string
    • deWeekDays2En

      @Nullable public static @Nullable String deWeekDays2En(String s)
      Convert two letter German weekdays to our standard
      Parameters:
      s - the String with the German weekday
      Returns:
      the standard weekday string
    • equals

      public static boolean equals(Object a, Object b)
      Returns true if the arguments are equal to each other and false otherwise.
      Parameters:
      a - the first object
      b - the second object
      Returns:
      true if the arguments are equal
      See Also: