Java Duration Calculate isDuration(String value)

Here you can find the source of isDuration(String value)

Description

is Duration

License

Open Source License

Declaration

public static boolean isDuration(String value) 

Method Source Code

//package com.java2s;
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

import java.time.Duration;

public class Main {
    public static boolean isDuration(String value) {
        try {/* w  w w .  j av a  2  s . c o m*/
            Duration.parse(value);

            return true;
        } catch (Exception e) {
            return false;
        }
    }
}

Related

  1. getDurationAsISO8601(Duration duration)
  2. getDurationByTimeValues(final long hours, final long minutes, final long seconds)
  3. getExpirationMillis(long now, Duration duration)
  4. getOrThrow(final ListenableFuture Future, final Duration timeout)
  5. getTTLSeconds(Duration duration)
  6. isFinite(Duration duration)
  7. isInfPositive(Duration duration)
  8. max(Duration a, Duration b)
  9. min(Duration a, Duration b)