private static PlainTime of( int hour, int minute, int second, int nanosecond, boolean validating ) { if ((minute | second | nanosecond) == 0) { if (validating) { return PlainTime.of(hour); } else { return HOURS[hour]; } } return new PlainTime(hour, minute, second, nanosecond, validating); }
/** * <p>Creates a wall time with hour and minute. </p> * * @param hour hour of day in the range {@code 0-23} or * {@code 24} if the given minute equals to {@code 0} * @param minute minute in the range {@code 0-59} * @return new or cached wall time * @throws IllegalArgumentException if any argument is out of range */ /*[deutsch] * <p>Erzeugt eine neue Uhrzeit mit Stunde und Minute. </p> * * @param hour hour of day in the range {@code 0-23} or * {@code 24} if the given minute equals to {@code 0} * @param minute minute in the range {@code 0-59} * @return new or cached wall time * @throws IllegalArgumentException if any argument is out of range */ public static PlainTime of( int hour, int minute ) { if (minute == 0) { return PlainTime.of(hour); } return new PlainTime(hour, minute, 0, 0, true); }
/** * <p>Creates a wall time with hour, minute and second. </p> * * @param hour hour in the range {@code 0-23} or {@code 24} * if the other arguments are equal to {@code 0} * @param minute minute in the range {@code 0-59} * @param second second in the range {@code 0-59} * @return new or cached wall time * @throws IllegalArgumentException if any argument is out of range */ /*[deutsch] * <p>Erzeugt eine neue Uhrzeit mit Stunde, Minute und Sekunde. </p> * * @param hour hour in the range {@code 0-23} or {@code 24} * if the other arguments are equal to {@code 0} * @param minute minute in the range {@code 0-59} * @param second second in the range {@code 0-59} * @return new or cached wall time * @throws IllegalArgumentException if any argument is out of range */ public static PlainTime of( int hour, int minute, int second ) { if ((minute | second) == 0) { return PlainTime.of(hour); } return new PlainTime(hour, minute, second, 0, true); }