List of usage examples for java.time LocalTime withMinute
public LocalTime withMinute(int minute)
From source file:com.haulmont.cuba.web.widgets.CubaTimeField.java
protected LocalTime applyResolutionToValue(LocalTime value) { if (value == null) { return null; }//from w w w . j a v a 2 s. c o m LocalTime result = LocalTime.MIDNIGHT; List<TimeResolution> resolutions = getResolutionsHigherOrEqualTo(getResolution()) .collect(Collectors.toList()); for (TimeResolution resolution : resolutions) { switch (resolution) { case HOUR: result = result.withHour(value.getHour()); break; case MINUTE: result = result.withMinute(value.getMinute()); break; case SECOND: result = result.withSecond(value.getSecond()); break; default: throw new IllegalArgumentException("Cannot detect resolution type"); } } return result; }