Java Duration Calculate max(Duration a, Duration b)

Here you can find the source of max(Duration a, Duration b)

Description

max

License

Open Source License

Declaration

public static Duration max(Duration a, Duration b) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.time.Duration;
import java.time.Instant;

public class Main {
    public static Duration max(Duration a, Duration b) {
        return a.compareTo(b) >= 0 ? a : b;
    }/*from  w  ww .  j a v  a  2  s  . com*/

    public static Instant max(Instant a, Instant b) {
        return a.compareTo(b) >= 0 ? a : b;
    }
}

Related

  1. getOrThrow(final ListenableFuture Future, final Duration timeout)
  2. getTTLSeconds(Duration duration)
  3. isDuration(String value)
  4. isFinite(Duration duration)
  5. isInfPositive(Duration duration)
  6. min(Duration a, Duration b)
  7. minutesToDuration(long minutes)
  8. multiply(Duration duration, double factor)
  9. runAfter(Duration duration, Runnable toRun)