Class DayOfWeekHelper

java.lang.Object
com.primavera.integration.util.DayOfWeekHelper

public final class DayOfWeekHelper extends Object
Helper to convert the day of the week value between integer and string types. Sunday is considered the first day of the week, with an index of 1.
  • Method Details

    • toInt

      public static int toInt(String dayOfWeek) throws InvalidValueException
      Converts the day of the week from a string to an integer. Sunday has an index of 1.
      Parameters:
      dayOfWeek - the day of week as a string: "Sunday", "Monday", etc.
      Returns:
      int the integer value of the day of the week
      Throws:
      InvalidValueException - when the input value is invalid
    • toString

      public static String toString(int dayOfWeek) throws InvalidValueException
      Converts the day of the week from an integer to a string.
      Parameters:
      dayOfWeek - the day of week as an integer: 1 is Sunday, 2 is Monday, etc.
      Returns:
      String the string value of the day of the week
      Throws:
      InvalidValueException - when the input value is out of range