Java Code Examples for java.time.DayOfWeek#TUESDAY

The following examples show how to use java.time.DayOfWeek#TUESDAY . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MergeBotFactory.java    From skara with GNU General Public License v2.0 6 votes vote down vote up
private static DayOfWeek toWeekday(String s) {
    switch (s.toLowerCase()) {
        case "monday":
            return DayOfWeek.MONDAY;
        case "tuesday":
            return DayOfWeek.TUESDAY;
        case "wednesday":
            return DayOfWeek.WEDNESDAY;
        case "thursday":
            return DayOfWeek.THURSDAY;
        case "friday":
            return DayOfWeek.FRIDAY;
        case "saturday":
            return DayOfWeek.SATURDAY;
        case "sunday":
            return DayOfWeek.SUNDAY;
        default:
            throw new IllegalArgumentException("Unknown weekday: " + s);
    }
}
 
Example 2
Source File: TCKWeekFields.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="IsoWeekData")
Object[][] data_week() {
    return new Object[][] {
            {LocalDate.of(1969, 12, 29), DayOfWeek.MONDAY, 1, 1970},
            {LocalDate.of(2012, 12, 23), DayOfWeek.SUNDAY, 51, 2012},
            {LocalDate.of(2012, 12, 24), DayOfWeek.MONDAY, 52, 2012},
            {LocalDate.of(2012, 12, 27), DayOfWeek.THURSDAY, 52, 2012},
            {LocalDate.of(2012, 12, 28), DayOfWeek.FRIDAY, 52, 2012},
            {LocalDate.of(2012, 12, 29), DayOfWeek.SATURDAY, 52, 2012},
            {LocalDate.of(2012, 12, 30), DayOfWeek.SUNDAY, 52, 2012},
            {LocalDate.of(2012, 12, 31), DayOfWeek.MONDAY, 1, 2013},
            {LocalDate.of(2013, 1, 1), DayOfWeek.TUESDAY, 1, 2013},
            {LocalDate.of(2013, 1, 2), DayOfWeek.WEDNESDAY, 1, 2013},
            {LocalDate.of(2013, 1, 6), DayOfWeek.SUNDAY, 1, 2013},
            {LocalDate.of(2013, 1, 7), DayOfWeek.MONDAY, 2, 2013},
    };
}
 
Example 3
Source File: TCKWeekFields.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="IsoWeekData")
Object[][] data_week() {
    return new Object[][] {
            {LocalDate.of(1969, 12, 29), DayOfWeek.MONDAY, 1, 1970},
            {LocalDate.of(2012, 12, 23), DayOfWeek.SUNDAY, 51, 2012},
            {LocalDate.of(2012, 12, 24), DayOfWeek.MONDAY, 52, 2012},
            {LocalDate.of(2012, 12, 27), DayOfWeek.THURSDAY, 52, 2012},
            {LocalDate.of(2012, 12, 28), DayOfWeek.FRIDAY, 52, 2012},
            {LocalDate.of(2012, 12, 29), DayOfWeek.SATURDAY, 52, 2012},
            {LocalDate.of(2012, 12, 30), DayOfWeek.SUNDAY, 52, 2012},
            {LocalDate.of(2012, 12, 31), DayOfWeek.MONDAY, 1, 2013},
            {LocalDate.of(2013, 1, 1), DayOfWeek.TUESDAY, 1, 2013},
            {LocalDate.of(2013, 1, 2), DayOfWeek.WEDNESDAY, 1, 2013},
            {LocalDate.of(2013, 1, 6), DayOfWeek.SUNDAY, 1, 2013},
            {LocalDate.of(2013, 1, 7), DayOfWeek.MONDAY, 2, 2013},
    };
}
 
Example 4
Source File: TCKWeekFields.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="IsoWeekData")
Object[][] data_week() {
    return new Object[][] {
            {LocalDate.of(1969, 12, 29), DayOfWeek.MONDAY, 1, 1970},
            {LocalDate.of(2012, 12, 23), DayOfWeek.SUNDAY, 51, 2012},
            {LocalDate.of(2012, 12, 24), DayOfWeek.MONDAY, 52, 2012},
            {LocalDate.of(2012, 12, 27), DayOfWeek.THURSDAY, 52, 2012},
            {LocalDate.of(2012, 12, 28), DayOfWeek.FRIDAY, 52, 2012},
            {LocalDate.of(2012, 12, 29), DayOfWeek.SATURDAY, 52, 2012},
            {LocalDate.of(2012, 12, 30), DayOfWeek.SUNDAY, 52, 2012},
            {LocalDate.of(2012, 12, 31), DayOfWeek.MONDAY, 1, 2013},
            {LocalDate.of(2013, 1, 1), DayOfWeek.TUESDAY, 1, 2013},
            {LocalDate.of(2013, 1, 2), DayOfWeek.WEDNESDAY, 1, 2013},
            {LocalDate.of(2013, 1, 6), DayOfWeek.SUNDAY, 1, 2013},
            {LocalDate.of(2013, 1, 7), DayOfWeek.MONDAY, 2, 2013},
    };
}
 
Example 5
Source File: TCKWeekFields.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="IsoWeekData")
Object[][] data_week() {
    return new Object[][] {
            {LocalDate.of(1969, 12, 29), DayOfWeek.MONDAY, 1, 1970},
            {LocalDate.of(2012, 12, 23), DayOfWeek.SUNDAY, 51, 2012},
            {LocalDate.of(2012, 12, 24), DayOfWeek.MONDAY, 52, 2012},
            {LocalDate.of(2012, 12, 27), DayOfWeek.THURSDAY, 52, 2012},
            {LocalDate.of(2012, 12, 28), DayOfWeek.FRIDAY, 52, 2012},
            {LocalDate.of(2012, 12, 29), DayOfWeek.SATURDAY, 52, 2012},
            {LocalDate.of(2012, 12, 30), DayOfWeek.SUNDAY, 52, 2012},
            {LocalDate.of(2012, 12, 31), DayOfWeek.MONDAY, 1, 2013},
            {LocalDate.of(2013, 1, 1), DayOfWeek.TUESDAY, 1, 2013},
            {LocalDate.of(2013, 1, 2), DayOfWeek.WEDNESDAY, 1, 2013},
            {LocalDate.of(2013, 1, 6), DayOfWeek.SUNDAY, 1, 2013},
            {LocalDate.of(2013, 1, 7), DayOfWeek.MONDAY, 2, 2013},
    };
}
 
Example 6
Source File: Utils.java    From schedge with MIT License 6 votes vote down vote up
public static DayOfWeek parseDayOfWeek(String dayOfWeek) {
  switch (dayOfWeek) {
  case "Mo":
    return DayOfWeek.MONDAY;
  case "Tu":
    return DayOfWeek.TUESDAY;
  case "We":
    return DayOfWeek.WEDNESDAY;
  case "Th":
    return DayOfWeek.THURSDAY;
  case "Fr":
    return DayOfWeek.FRIDAY;
  case "Sa":
    return DayOfWeek.SATURDAY;
  case "Su":
    return DayOfWeek.SUNDAY;
  default:
    return DayOfWeek.valueOf(dayOfWeek);
  }
}
 
Example 7
Source File: TCKWeekFields.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="IsoWeekData")
Object[][] data_week() {
    return new Object[][] {
            {LocalDate.of(1969, 12, 29), DayOfWeek.MONDAY, 1, 1970},
            {LocalDate.of(2012, 12, 23), DayOfWeek.SUNDAY, 51, 2012},
            {LocalDate.of(2012, 12, 24), DayOfWeek.MONDAY, 52, 2012},
            {LocalDate.of(2012, 12, 27), DayOfWeek.THURSDAY, 52, 2012},
            {LocalDate.of(2012, 12, 28), DayOfWeek.FRIDAY, 52, 2012},
            {LocalDate.of(2012, 12, 29), DayOfWeek.SATURDAY, 52, 2012},
            {LocalDate.of(2012, 12, 30), DayOfWeek.SUNDAY, 52, 2012},
            {LocalDate.of(2012, 12, 31), DayOfWeek.MONDAY, 1, 2013},
            {LocalDate.of(2013, 1, 1), DayOfWeek.TUESDAY, 1, 2013},
            {LocalDate.of(2013, 1, 2), DayOfWeek.WEDNESDAY, 1, 2013},
            {LocalDate.of(2013, 1, 6), DayOfWeek.SUNDAY, 1, 2013},
            {LocalDate.of(2013, 1, 7), DayOfWeek.MONDAY, 2, 2013},
    };
}
 
Example 8
Source File: TCKWeekFields.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="IsoWeekData")
Object[][] data_week() {
    return new Object[][] {
            {LocalDate.of(1969, 12, 29), DayOfWeek.MONDAY, 1, 1970},
            {LocalDate.of(2012, 12, 23), DayOfWeek.SUNDAY, 51, 2012},
            {LocalDate.of(2012, 12, 24), DayOfWeek.MONDAY, 52, 2012},
            {LocalDate.of(2012, 12, 27), DayOfWeek.THURSDAY, 52, 2012},
            {LocalDate.of(2012, 12, 28), DayOfWeek.FRIDAY, 52, 2012},
            {LocalDate.of(2012, 12, 29), DayOfWeek.SATURDAY, 52, 2012},
            {LocalDate.of(2012, 12, 30), DayOfWeek.SUNDAY, 52, 2012},
            {LocalDate.of(2012, 12, 31), DayOfWeek.MONDAY, 1, 2013},
            {LocalDate.of(2013, 1, 1), DayOfWeek.TUESDAY, 1, 2013},
            {LocalDate.of(2013, 1, 2), DayOfWeek.WEDNESDAY, 1, 2013},
            {LocalDate.of(2013, 1, 6), DayOfWeek.SUNDAY, 1, 2013},
            {LocalDate.of(2013, 1, 7), DayOfWeek.MONDAY, 2, 2013},
    };
}
 
Example 9
Source File: WeeklyPlanningServiceImp.java    From axelor-open-suite with GNU Affero General Public License v3.0 6 votes vote down vote up
private DayOfWeek getDayOfWeek(DayPlanning day) {
  switch (day.getName()) {
    case "monday":
      return DayOfWeek.MONDAY;
    case "tuesday":
      return DayOfWeek.TUESDAY;
    case "wednesday":
      return DayOfWeek.WEDNESDAY;
    case "thursday":
      return DayOfWeek.THURSDAY;
    case "friday":
      return DayOfWeek.FRIDAY;
    case "saturday":
      return DayOfWeek.SATURDAY;
    case "sunday":
      return DayOfWeek.SUNDAY;
    default:
      return DayOfWeek.SUNDAY;
  }
}
 
Example 10
Source File: TCKWeekFields.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="IsoWeekData")
Object[][] data_week() {
    return new Object[][] {
            {LocalDate.of(1969, 12, 29), DayOfWeek.MONDAY, 1, 1970},
            {LocalDate.of(2012, 12, 23), DayOfWeek.SUNDAY, 51, 2012},
            {LocalDate.of(2012, 12, 24), DayOfWeek.MONDAY, 52, 2012},
            {LocalDate.of(2012, 12, 27), DayOfWeek.THURSDAY, 52, 2012},
            {LocalDate.of(2012, 12, 28), DayOfWeek.FRIDAY, 52, 2012},
            {LocalDate.of(2012, 12, 29), DayOfWeek.SATURDAY, 52, 2012},
            {LocalDate.of(2012, 12, 30), DayOfWeek.SUNDAY, 52, 2012},
            {LocalDate.of(2012, 12, 31), DayOfWeek.MONDAY, 1, 2013},
            {LocalDate.of(2013, 1, 1), DayOfWeek.TUESDAY, 1, 2013},
            {LocalDate.of(2013, 1, 2), DayOfWeek.WEDNESDAY, 1, 2013},
            {LocalDate.of(2013, 1, 6), DayOfWeek.SUNDAY, 1, 2013},
            {LocalDate.of(2013, 1, 7), DayOfWeek.MONDAY, 2, 2013},
    };
}
 
Example 11
Source File: StringColumnDayOfWeekMapper.java    From jadira with Apache License 2.0 5 votes vote down vote up
@Override
public DayOfWeek fromNonNullValue(String s) {
	
	switch(s) {
		case "SATURDAY" : return DayOfWeek.SATURDAY;
		case "SUNDAY" : return DayOfWeek.SUNDAY;
		case "MONDAY" : return DayOfWeek.MONDAY;
		case "TUESDAY" : return DayOfWeek.TUESDAY;
		case "WEDNESDAY" : return DayOfWeek.WEDNESDAY;
		case "THURSDAY" : return DayOfWeek.THURSDAY;
		case "FRIDAY" : return DayOfWeek.FRIDAY;
		default: throw new IllegalArgumentException("Seen unexpected DayOfWeek: " + s);
	}
}
 
Example 12
Source File: TimeSection.java    From tilesfx with Apache License 2.0 4 votes vote down vote up
public TimeSection(final LocalTime START, final LocalTime STOP, final String TEXT, final Color COLOR, final Color TEXT_COLOR) {
    this(START, STOP, TEXT, null, COLOR, COLOR, TEXT_COLOR, false, DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, DayOfWeek.FRIDAY, DayOfWeek.SATURDAY, DayOfWeek.SUNDAY);
}
 
Example 13
Source File: PackedLocalDateTime.java    From tablesaw with Apache License 2.0 4 votes vote down vote up
public static boolean isTuesday(long packedDateTime) {
  if (packedDateTime == missingValueIndicator()) return false;
  DayOfWeek dayOfWeek = getDayOfWeek(packedDateTime);
  return dayOfWeek == DayOfWeek.TUESDAY;
}
 
Example 14
Source File: TimeSection.java    From tilesfx with Apache License 2.0 4 votes vote down vote up
public TimeSection(final LocalTime START, final LocalTime STOP, final Color COLOR, final Color HIGHLIGHT_COLOR) {
    this(START, STOP, "", null, COLOR, HIGHLIGHT_COLOR, Color.TRANSPARENT, false, DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, DayOfWeek.FRIDAY, DayOfWeek.SATURDAY, DayOfWeek.SUNDAY);
}
 
Example 15
Source File: PackedLocalDateTime.java    From tablesaw with Apache License 2.0 4 votes vote down vote up
public static boolean isTuesday(long packedDateTime) {
  if (packedDateTime == missingValueIndicator()) return false;
  DayOfWeek dayOfWeek = getDayOfWeek(packedDateTime);
  return dayOfWeek == DayOfWeek.TUESDAY;
}
 
Example 16
Source File: TimeSection.java    From OEE-Designer with MIT License 4 votes vote down vote up
public TimeSection(final LocalTime START, final LocalTime STOP, final Image ICON, final Color COLOR) {
    this(START, STOP, "", ICON, COLOR, COLOR, Color.WHITE, false, DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, DayOfWeek.FRIDAY, DayOfWeek.SATURDAY, DayOfWeek.SUNDAY);
}
 
Example 17
Source File: TimeSection.java    From OEE-Designer with MIT License 4 votes vote down vote up
public TimeSection(final LocalTime START, final LocalTime STOP, final Color COLOR, final Color HIGHLIGHT_COLOR) {
    this(START, STOP, "", null, COLOR, HIGHLIGHT_COLOR, Color.TRANSPARENT, false, DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, DayOfWeek.FRIDAY, DayOfWeek.SATURDAY, DayOfWeek.SUNDAY);
}
 
Example 18
Source File: TimeSection.java    From OEE-Designer with MIT License 4 votes vote down vote up
public TimeSection(final LocalTime START, final LocalTime STOP, final Color COLOR) {
    this(START, STOP, "", null, COLOR, COLOR, Color.TRANSPARENT, false, DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, DayOfWeek.FRIDAY, DayOfWeek.SATURDAY, DayOfWeek.SUNDAY);
}
 
Example 19
Source File: TimeSection.java    From OEE-Designer with MIT License 4 votes vote down vote up
public TimeSection(final LocalTime START, final LocalTime STOP) {
    this(START, STOP, "", null, Color.TRANSPARENT, Color.TRANSPARENT, Color.TRANSPARENT, false, DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, DayOfWeek.FRIDAY, DayOfWeek.SATURDAY, DayOfWeek.SUNDAY);
}
 
Example 20
Source File: DateMatchers.java    From elexis-3-core with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * Creates a matcher that matches when the examined date is on a tuesday
 * <p/>
 * For example:
 *
 * <pre>
 * assertThat(myDate, isTuesday());
 * </pre>
 */
public static Matcher<Date> isTuesday() {
    return new IsDayOfWeek<Date>(DayOfWeek.TUESDAY, DateMatchers::dateToZoneDateTime);
}