congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Duration.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.nuecho.rivr.core.util.Duration
constructor

Best Java code snippets using com.nuecho.rivr.core.util.Duration.<init> (Showing top 7 results out of 315)

origin: nuecho/rivr

public static Duration seconds(long seconds) {
  Assert.between(0, seconds, Long.MAX_VALUE / SECOND_IN_MILLIS);
  return new Duration(seconds * SECOND_IN_MILLIS);
}
origin: nuecho/rivr

public static Duration year(long year) {
  Assert.between(0, year, Long.MAX_VALUE / YEAR_IN_MILLIS);
  return new Duration(year * YEAR_IN_MILLIS);
}
origin: nuecho/rivr

public static Duration days(long days) {
  Assert.between(0, days, Long.MAX_VALUE / DAY_IN_MILLIS);
  return new Duration(days * DAY_IN_MILLIS);
}
origin: nuecho/rivr

public static Duration milliseconds(long milliseconds) {
  Assert.notNegative(milliseconds, "milliseconds");
  return new Duration(milliseconds);
}
origin: nuecho/rivr

public static Duration minutes(long minutes) {
  Assert.between(0, minutes, Long.MAX_VALUE / MINUTE_IN_MILLIS);
  return new Duration(minutes * MINUTE_IN_MILLIS);
}
origin: nuecho/rivr

public static Duration hours(long hours) {
  Assert.between(0, hours, Long.MAX_VALUE / HOUR_IN_MILLIS);
  return new Duration(hours * HOUR_IN_MILLIS);
}
origin: nuecho/rivr

public static Duration sum(Duration a, Duration b) {
  long millisecondsA = a.getMilliseconds();
  long millisecondsB = b.getMilliseconds();
  long allowedMax = Long.MAX_VALUE - millisecondsA;
  if (millisecondsB > allowedMax) throw new AssertionError("Time sum would overflow Long capacity.");
  return new Duration(millisecondsA + millisecondsB);
}
com.nuecho.rivr.core.utilDuration<init>

Popular methods of Duration

  • getMilliseconds
  • milliseconds
  • append
  • days
  • equals
  • hashCode
  • hours
  • minutes
  • parse
  • seconds
  • sum
  • year
  • sum,
  • year

Popular in Java

  • Creating JSON documents from java classes using gson
  • findViewById (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • getContentResolver (Context)
  • Path (java.nio.file)
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now