@Override public LocalTime convert(LocalDateTime source) { return source.toLocalTime(); } }
@Override public LocalTime convert(LocalDateTime source) { return source.toLocalTime(); } }
/** * Parses only the local time from the given text, returning a new LocalTime. * <p> * This will parse the text fully according to the formatter, using the UTC zone. * Once parsed, only the local time will be used. * This means that any parsed date, time-zone or offset field is completely ignored. * It also means that the zone and offset-parsed settings are ignored. * * @param text the text to parse, not null * @return the parsed time, never null * @throws UnsupportedOperationException if parsing is not supported * @throws IllegalArgumentException if the text to parse is invalid * @since 2.0 */ public LocalTime parseLocalTime(String text) { return parseLocalDateTime(text).toLocalTime(); }
/** * Parses only the local time from the given text, returning a new LocalTime. * <p> * This will parse the text fully according to the formatter, using the UTC zone. * Once parsed, only the local time will be used. * This means that any parsed date, time-zone or offset field is completely ignored. * It also means that the zone and offset-parsed settings are ignored. * * @param text the text to parse, not null * @return the parsed time, never null * @throws UnsupportedOperationException if parsing is not supported * @throws IllegalArgumentException if the text to parse is invalid * @since 2.0 */ public LocalTime parseLocalTime(String text) { return parseLocalDateTime(text).toLocalTime(); }
if (text.length() == 23) { LocalDateTime localDateTime = LocalDateTime.parse(text); localDate = localDateTime.toLocalTime(); } else { localDate = LocalTime.parse(text); return (T) localDateTime.toLocalTime();
if (text.length() == 23) { LocalDateTime localDateTime = LocalDateTime.parse(text); localDate = localDateTime.toLocalTime(); } else { localDate = LocalTime.parse(text); return (T) localDateTime.toLocalTime();
/** * Parses only the local time from the given text, returning a new LocalDate. * <p> * This will parse the text fully according to the formatter, using the UTC zone. * Once parsed, only the local time will be used. * This means that any parsed date, time-zone or offset field is completely ignored. * It also means that the zone and offset-parsed settings are ignored. * * @param text the text to parse, not null * @return the parsed time, never null * @throws UnsupportedOperationException if parsing is not supported * @throws IllegalArgumentException if the text to parse is invalid * @since 2.0 */ public LocalTime parseLocalTime(String text) { return parseLocalDateTime(text).toLocalTime(); }
@Override public LocalTime convert(LocalDateTime source) { return source.toLocalTime(); } }
@Override public Object parseObject(String source) throws ParseException { if ((source.length() >= 1) && ((source.charAt(0) == '+') || ((source.charAt(0) == '-')))) { return transformText(source, pattern).toLocalTime(); } if (StringUtils.isBlank(source)) { return null; } return super.parseObject(source); } }
/** * Parses only the local time from the given text, returning a new LocalTime. * <p> * This will parse the text fully according to the formatter, using the UTC zone. * Once parsed, only the local time will be used. * This means that any parsed date, time-zone or offset field is completely ignored. * It also means that the zone and offset-parsed settings are ignored. * * @param text the text to parse, not null * @return the parsed time, never null * @throws UnsupportedOperationException if parsing is not supported * @throws IllegalArgumentException if the text to parse is invalid * @since 2.0 */ public LocalTime parseLocalTime(String text) { return parseLocalDateTime(text).toLocalTime(); }
/** * Parses only the local time from the given text, returning a new LocalTime. * <p> * This will parse the text fully according to the formatter, using the UTC zone. * Once parsed, only the local time will be used. * This means that any parsed date, time-zone or offset field is completely ignored. * It also means that the zone and offset-parsed settings are ignored. * * @param text the text to parse, not null * @return the parsed time, never null * @throws UnsupportedOperationException if parsing is not supported * @throws IllegalArgumentException if the text to parse is invalid * @since 2.0 */ public LocalTime parseLocalTime(String text) { return parseLocalDateTime(text).toLocalTime(); }
/** * Parses only the local time from the given text, returning a new LocalTime. * <p> * This will parse the text fully according to the formatter, using the UTC zone. * Once parsed, only the local time will be used. * This means that any parsed date, time-zone or offset field is completely ignored. * It also means that the zone and offset-parsed settings are ignored. * * @param text the text to parse, not null * @return the parsed time, never null * @throws UnsupportedOperationException if parsing is not supported * @throws IllegalArgumentException if the text to parse is invalid * @since 2.0 */ public LocalTime parseLocalTime(String text) { return parseLocalDateTime(text).toLocalTime(); }
/** * Parses only the local time from the given text, returning a new LocalTime. * <p> * This will parse the text fully according to the formatter, using the UTC zone. * Once parsed, only the local time will be used. * This means that any parsed date, time-zone or offset field is completely ignored. * It also means that the zone and offset-parsed settings are ignored. * * @param text the text to parse, not null * @return the parsed time, never null * @throws UnsupportedOperationException if parsing is not supported * @throws IllegalArgumentException if the text to parse is invalid * @since 2.0 */ public LocalTime parseLocalTime(String text) { return parseLocalDateTime(text).toLocalTime(); }
/** * Parses only the local time from the given text, returning a new LocalDate. * <p> * This will parse the text fully according to the formatter, using the UTC zone. * Once parsed, only the local time will be used. * This means that any parsed date, time-zone or offset field is completely ignored. * It also means that the zone and offset-parsed settings are ignored. * * @param text the text to parse, not null * @return the parsed time, never null * @throws UnsupportedOperationException if parsing is not supported * @throws IllegalArgumentException if the text to parse is invalid * @since 2.0 */ public LocalTime parseLocalTime(String text) { return parseLocalDateTime(text).toLocalTime(); }
/** * Parses only the local time from the given text, returning a new LocalTime. * <p> * This will parse the text fully according to the formatter, using the UTC zone. * Once parsed, only the local time will be used. * This means that any parsed date, time-zone or offset field is completely ignored. * It also means that the zone and offset-parsed settings are ignored. * * @param text the text to parse, not null * @return the parsed time, never null * @throws UnsupportedOperationException if parsing is not supported * @throws IllegalArgumentException if the text to parse is invalid * @since 2.0 */ public LocalTime parseLocalTime(String text) { return parseLocalDateTime(text).toLocalTime(); }
/** * Parses only the local time from the given text, returning a new LocalTime. * <p> * This will parse the text fully according to the formatter, using the UTC zone. * Once parsed, only the local time will be used. * This means that any parsed date, time-zone or offset field is completely ignored. * It also means that the zone and offset-parsed settings are ignored. * * @param text the text to parse, not null * @return the parsed time, never null * @throws UnsupportedOperationException if parsing is not supported * @throws IllegalArgumentException if the text to parse is invalid * @since 2.0 */ public LocalTime parseLocalTime(String text) { return parseLocalDateTime(text).toLocalTime(); }