All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.signal.libsignal.net.DurationExt Maven / Gradle / Ivy

There is a newer version: 0.62.0
Show newest version
//
// Copyright 2024 Signal Messenger, LLC.
// SPDX-License-Identifier: AGPL-3.0-only
//

package org.signal.libsignal.net;

import java.time.Duration;

public abstract class DurationExt {
  public static final int timeoutMillis(Duration timeout) {
    int millis;
    try {
      millis = Math.toIntExact(timeout.toMillis());
    } catch (ArithmeticException e) {
      millis = Integer.MAX_VALUE;
    }
    return millis;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy