Class GranularityChoice

java.lang.Object
energy.eddie.regionconnector.shared.validation.GranularityChoice

public class GranularityChoice extends Object
  • Constructor Details

    • GranularityChoice

      public GranularityChoice(List<Granularity> supportedGranularities)
  • Method Details

    • find

      @Nullable public Granularity find(Granularity min, Granularity max)
    • isBetween

      public static boolean isBetween(Granularity current, Granularity min, Granularity max)
      Returns true if the minute granularity is between the min and max granularities. Is inclusive
      Parameters:
      current - the granularity that is checked
      min - the lower acceptable granularity
      max - the higher acceptable granularity
      Returns:
      true if the current granularity is between the min and max, otherwise false
    • findAll

      public List<Granularity> findAll(Granularity min, Granularity max)