Here you can find the source of getDurationByTimeValues(final long hours, final long minutes, final long seconds)
Parameter | Description |
---|---|
hours | count of hours |
minutes | count of minutes |
seconds | count of seconds |
public static Duration getDurationByTimeValues(final long hours, final long minutes, final long seconds)
//package com.java2s; /**//from w w w. j av a2 s . c o m * Copyright (c) 2015 Bosch Software Innovations GmbH and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ import java.time.Duration; public class Main { /** * converts values of time constants to a Duration object.. * * @param hours * count of hours * @param minutes * count of minutes * @param seconds * count of seconds * @return duration */ public static Duration getDurationByTimeValues(final long hours, final long minutes, final long seconds) { return Duration.ofHours(hours).plusMinutes(minutes).plusSeconds(seconds); } }