Classes | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Attributes | List of all members
com.google.protobuf.util.Durations Class Reference

Classes

enum  DurationComparator
 

Static Public Member Functions

static Duration add (Duration d1, Duration d2)
 
static Duration add (Duration d1, Duration d2)
 
static Duration checkNotNegative (Duration duration)
 
static Duration checkNotNegative (Duration duration)
 
static Duration checkPositive (Duration duration)
 
static Duration checkPositive (Duration duration)
 
static Duration checkValid (Duration duration)
 
static Duration checkValid (Duration duration)
 
static Duration checkValid (Duration.Builder durationBuilder)
 
static Duration checkValid (Duration.Builder durationBuilder)
 
static Comparator< Durationcomparator ()
 
static Comparator< Durationcomparator ()
 
static int compare (Duration x, Duration y)
 
static int compare (Duration x, Duration y)
 
static Duration fromDays (long days)
 
static Duration fromDays (long days)
 
static Duration fromHours (long hours)
 
static Duration fromHours (long hours)
 
static Duration fromMicros (long microseconds)
 
static Duration fromMicros (long microseconds)
 
static Duration fromMillis (long milliseconds)
 
static Duration fromMillis (long milliseconds)
 
static Duration fromMinutes (long minutes)
 
static Duration fromMinutes (long minutes)
 
static Duration fromNanos (long nanoseconds)
 
static Duration fromNanos (long nanoseconds)
 
static Duration fromSeconds (long seconds)
 
static Duration fromSeconds (long seconds)
 
static boolean isNegative (Duration duration)
 
static boolean isNegative (Duration duration)
 
static boolean isPositive (Duration duration)
 
static boolean isValid (Duration duration)
 
static boolean isValid (Duration duration)
 
static boolean isValid (long seconds, int nanos)
 
static boolean isValid (long seconds, int nanos)
 
static Duration parse (String value) throws ParseException
 
static Duration parse (String value) throws ParseException
 
static Duration parseUnchecked (@CompileTimeConstant String value)
 
static Duration subtract (Duration d1, Duration d2)
 
static Duration subtract (Duration d1, Duration d2)
 
static long toDays (Duration duration)
 
static long toDays (Duration duration)
 
static long toHours (Duration duration)
 
static long toHours (Duration duration)
 
static long toMicros (Duration duration)
 
static long toMicros (Duration duration)
 
static long toMillis (Duration duration)
 
static long toMillis (Duration duration)
 
static long toMinutes (Duration duration)
 
static long toMinutes (Duration duration)
 
static long toNanos (Duration duration)
 
static long toNanos (Duration duration)
 
static long toSeconds (Duration duration)
 
static long toSeconds (Duration duration)
 
static double toSecondsAsDouble (Duration duration)
 
static double toSecondsAsDouble (Duration duration)
 
static String toString (Duration duration)
 
static String toString (Duration duration)
 

Static Public Attributes

static final Duration MAX_VALUE
 
static final Duration MIN_VALUE
 
static final Duration ZERO = Duration.newBuilder().setSeconds(0L).setNanos(0).build()
 

Private Member Functions

 Durations ()
 
 Durations ()
 

Static Private Attributes

static final Comparator< DurationCOMPARATOR
 
static final long SECONDS_PER_DAY = SECONDS_PER_HOUR * 24
 
static final long SECONDS_PER_HOUR = SECONDS_PER_MINUTE * 60
 
static final long SECONDS_PER_MINUTE = 60L
 

Detailed Description

Utilities to help create/manipulate

protobuf/duration.proto

. All operations throw an IllegalArgumentException if the input(s) are not {@linkplain isValid(Duration) valid}.

Definition at line 54 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

Constructor & Destructor Documentation

◆ Durations() [1/2]

com.google.protobuf.util.Durations.Durations ( )
inlineprivate

◆ Durations() [2/2]

com.google.protobuf.util.Durations.Durations ( )
inlineprivate

Member Function Documentation

◆ add() [1/2]

static Duration com.google.protobuf.util.Durations.add ( Duration  d1,
Duration  d2 
)
inlinestatic

◆ add() [2/2]

static Duration com.google.protobuf.util.Durations.add ( Duration  d1,
Duration  d2 
)
inlinestatic

Add two durations.

Definition at line 447 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ checkNotNegative() [1/2]

static Duration com.google.protobuf.util.Durations.checkNotNegative ( Duration  duration)
inlinestatic

Ensures that the given Duration is not negative.

Exceptions
IllegalArgumentExceptionif
duration
is negative or invalid
NullPointerExceptionif
duration
is
null

Definition at line 156 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ checkNotNegative() [2/2]

static Duration com.google.protobuf.util.Durations.checkNotNegative ( Duration  duration)
inlinestatic

Ensures that the given Duration is not negative.

Exceptions
IllegalArgumentExceptionif
duration
is negative or invalid
NullPointerExceptionif
duration
is
null

Definition at line 166 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ checkPositive() [1/2]

static Duration com.google.protobuf.util.Durations.checkPositive ( Duration  duration)
inlinestatic

Ensures that the given Duration is positive.

Exceptions
IllegalArgumentExceptionif
duration
is negative, , or invalid
NullPointerExceptionif
duration
is
null

Definition at line 169 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ checkPositive() [2/2]

static Duration com.google.protobuf.util.Durations.checkPositive ( Duration  duration)
inlinestatic

Ensures that the given Duration is positive.

Exceptions
IllegalArgumentExceptionif
duration
is negative, , or invalid
NullPointerExceptionif
duration
is
null

Definition at line 178 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ checkValid() [1/4]

static Duration com.google.protobuf.util.Durations.checkValid ( Duration  duration)
inlinestatic

◆ checkValid() [2/4]

static Duration com.google.protobuf.util.Durations.checkValid ( Duration  duration)
inlinestatic

◆ checkValid() [3/4]

static Duration com.google.protobuf.util.Durations.checkValid ( Duration.Builder  durationBuilder)
inlinestatic

Builds the given builder and throws an IllegalArgumentException if it is not valid. See checkValid(Duration).

Returns
A valid, built Duration.

Definition at line 201 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ checkValid() [4/4]

static Duration com.google.protobuf.util.Durations.checkValid ( Duration.Builder  durationBuilder)
inlinestatic

Builds the given builder and throws an IllegalArgumentException if it is not valid. See checkValid(Duration).

Returns
A valid, built Duration.

Definition at line 206 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ comparator() [1/2]

static Comparator<Duration> com.google.protobuf.util.Durations.comparator ( )
inlinestatic

Returns a Comparator for Durations which sorts in increasing chronological order. Nulls and invalid Durations are not allowed (see isValid).

Definition at line 90 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ comparator() [2/2]

static Comparator<Duration> com.google.protobuf.util.Durations.comparator ( )
inlinestatic

Returns a Comparator for Durations which sorts in increasing chronological order. Nulls and invalid Durations are not allowed (see isValid). The returned comparator is serializable.

Definition at line 94 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ compare() [1/2]

static int com.google.protobuf.util.Durations.compare ( Duration  x,
Duration  y 
)
inlinestatic

Compares two durations. The value returned is identical to what would be returned by:

Durations.comparator().compare(x, y)

.

Returns
the value
0
if
x == y
; a value less than
0
if
x < y
; and a value greater than
0
if
x > y

Definition at line 101 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ compare() [2/2]

static int com.google.protobuf.util.Durations.compare ( Duration  x,
Duration  y 
)
inlinestatic

Compares two durations. The value returned is identical to what would be returned by:

Durations.comparator().compare(x, y)

.

Returns
the value
0
if
x == y
; a value less than
0
if
x < y
; and a value greater than
0
if
x > y

Definition at line 105 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ fromDays() [1/2]

static Duration com.google.protobuf.util.Durations.fromDays ( long  days)
inlinestatic

◆ fromDays() [2/2]

static Duration com.google.protobuf.util.Durations.fromDays ( long  days)
inlinestatic

Create a Duration from the number of days.

Definition at line 302 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ fromHours() [1/2]

static Duration com.google.protobuf.util.Durations.fromHours ( long  hours)
inlinestatic

◆ fromHours() [2/2]

static Duration com.google.protobuf.util.Durations.fromHours ( long  hours)
inlinestatic

Create a Duration from the number of hours.

Definition at line 311 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ fromMicros() [1/2]

static Duration com.google.protobuf.util.Durations.fromMicros ( long  microseconds)
inlinestatic

Create a Duration from the number of microseconds.

Definition at line 319 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ fromMicros() [2/2]

static Duration com.google.protobuf.util.Durations.fromMicros ( long  microseconds)
inlinestatic

Create a Duration from the number of microseconds.

Definition at line 343 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ fromMillis() [1/2]

static Duration com.google.protobuf.util.Durations.fromMillis ( long  milliseconds)
inlinestatic

Create a Duration from the number of milliseconds.

Definition at line 311 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ fromMillis() [2/2]

static Duration com.google.protobuf.util.Durations.fromMillis ( long  milliseconds)
inlinestatic

Create a Duration from the number of milliseconds.

Definition at line 335 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ fromMinutes() [1/2]

static Duration com.google.protobuf.util.Durations.fromMinutes ( long  minutes)
inlinestatic

Create a Duration from the number of minutes.

Definition at line 296 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ fromMinutes() [2/2]

static Duration com.google.protobuf.util.Durations.fromMinutes ( long  minutes)
inlinestatic

Create a Duration from the number of minutes.

Definition at line 320 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ fromNanos() [1/2]

static Duration com.google.protobuf.util.Durations.fromNanos ( long  nanoseconds)
inlinestatic

Create a Duration from the number of nanoseconds.

Definition at line 327 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ fromNanos() [2/2]

static Duration com.google.protobuf.util.Durations.fromNanos ( long  nanoseconds)
inlinestatic

Create a Duration from the number of nanoseconds.

Definition at line 351 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ fromSeconds() [1/2]

static Duration com.google.protobuf.util.Durations.fromSeconds ( long  seconds)
inlinestatic

Create a Duration from the number of seconds.

Definition at line 305 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ fromSeconds() [2/2]

static Duration com.google.protobuf.util.Durations.fromSeconds ( long  seconds)
inlinestatic

Create a Duration from the number of seconds.

Definition at line 329 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ isNegative() [1/2]

static boolean com.google.protobuf.util.Durations.isNegative ( Duration  duration)
inlinestatic

Returns whether the given Duration is negative or not.

Definition at line 144 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ isNegative() [2/2]

static boolean com.google.protobuf.util.Durations.isNegative ( Duration  duration)
inlinestatic

Returns whether the given Duration is negative or not.

Definition at line 148 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ isPositive()

static boolean com.google.protobuf.util.Durations.isPositive ( Duration  duration)
inlinestatic

Returns whether the given Duration is positive or not.

Definition at line 154 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ isValid() [1/4]

static boolean com.google.protobuf.util.Durations.isValid ( Duration  duration)
inlinestatic

Returns true if the given Duration is valid. The

value must be in the range [-315,576,000,000, +315,576,000,000]. The

nanos

value must be in the range [-999,999,999, +999,999,999].

Note: Durations less than one second are represented with a 0

field and a positive or negative

nanos

field. For durations of one second or more, a non-zero value for the

nanos

field must be of the same sign as the

field.

Definition at line 114 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ isValid() [2/4]

static boolean com.google.protobuf.util.Durations.isValid ( Duration  duration)
inlinestatic

Returns true if the given Duration is valid. The

value must be in the range [-315,576,000,000, +315,576,000,000]. The

nanos

value must be in the range [-999,999,999, +999,999,999].

Note: Durations less than one second are represented with a 0

field and a positive or negative

nanos

field. For durations of one second or more, a non-zero value for the

nanos

field must be of the same sign as the

field.

Definition at line 118 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ isValid() [3/4]

static boolean com.google.protobuf.util.Durations.isValid ( long  seconds,
int  nanos 
)
inlinestatic

Returns true if the given number of seconds and nanos is a valid Duration. The

value must be in the range [-315,576,000,000, +315,576,000,000]. The

nanos

value must be in the range [-999,999,999, +999,999,999].

Note: Durations less than one second are represented with a 0

field and a positive or negative

nanos

field. For durations of one second or more, a non-zero value for the

nanos

field must be of the same sign as the

field.

Definition at line 128 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ isValid() [4/4]

static boolean com.google.protobuf.util.Durations.isValid ( long  seconds,
int  nanos 
)
inlinestatic

Returns true if the given number of seconds and nanos is a valid Duration. The

value must be in the range [-315,576,000,000, +315,576,000,000]. The

nanos

value must be in the range [-999,999,999, +999,999,999].

Note: Durations less than one second are represented with a 0

field and a positive or negative

nanos

field. For durations of one second or more, a non-zero value for the

nanos

field must be of the same sign as the

field.

Definition at line 132 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ parse() [1/2]

static Duration com.google.protobuf.util.Durations.parse ( String  value) throws ParseException
inlinestatic

Parse from a string to produce a duration.

Returns
A Duration parsed from the string.
Exceptions
ParseExceptionif parsing fails.

Definition at line 241 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ parse() [2/2]

static Duration com.google.protobuf.util.Durations.parse ( String  value) throws ParseException
inlinestatic

Parse from a string to produce a duration.

Returns
A Duration parsed from the string.
Exceptions
ParseExceptionif parsing fails.

Definition at line 246 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ parseUnchecked()

static Duration com.google.protobuf.util.Durations.parseUnchecked ( @CompileTimeConstant String  value)
inlinestatic

Parses a string in RFC 3339 format into a Duration.

Identical to parse(String), but throws an IllegalArgumentException instead of a ParseException if parsing fails.

Returns
a Duration parsed from the string
Exceptions
IllegalArgumentExceptionif parsing fails

Definition at line 288 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ subtract() [1/2]

static Duration com.google.protobuf.util.Durations.subtract ( Duration  d1,
Duration  d2 
)
inlinestatic

Subtract a duration from another.

Definition at line 431 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ subtract() [2/2]

static Duration com.google.protobuf.util.Durations.subtract ( Duration  d1,
Duration  d2 
)
inlinestatic

Subtract a duration from another.

Definition at line 455 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ toDays() [1/2]

static long com.google.protobuf.util.Durations.toDays ( Duration  duration)
inlinestatic

Convert a Duration to the number of days. The result will be rounded towards 0 to the nearest day.

Definition at line 339 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ toDays() [2/2]

static long com.google.protobuf.util.Durations.toDays ( Duration  duration)
inlinestatic

Convert a Duration to the number of days. The result will be rounded towards 0 to the nearest day.

Definition at line 363 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ toHours() [1/2]

static long com.google.protobuf.util.Durations.toHours ( Duration  duration)
inlinestatic

Convert a Duration to the number of hours. The result will be rounded towards 0 to the nearest hour.

Definition at line 348 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ toHours() [2/2]

static long com.google.protobuf.util.Durations.toHours ( Duration  duration)
inlinestatic

Convert a Duration to the number of hours. The result will be rounded towards 0 to the nearest hour.

Definition at line 372 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ toMicros() [1/2]

static long com.google.protobuf.util.Durations.toMicros ( Duration  duration)
inlinestatic

Convert a Duration to the number of microseconds. The result will be rounded towards 0 to the nearest microseconds. E.g., if the duration represents -1 nanosecond, it will be rounded to 0.

Definition at line 405 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ toMicros() [2/2]

static long com.google.protobuf.util.Durations.toMicros ( Duration  duration)
inlinestatic

Convert a Duration to the number of microseconds. The result will be rounded towards 0 to the nearest microseconds. E.g., if the duration represents -1 nanosecond, it will be rounded to 0.

Definition at line 429 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ toMillis() [1/2]

static long com.google.protobuf.util.Durations.toMillis ( Duration  duration)
inlinestatic

Convert a Duration to the number of milliseconds. The result will be rounded towards 0 to the nearest millisecond. E.g., if the duration represents -1 nanosecond, it will be rounded to 0.

Definition at line 393 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ toMillis() [2/2]

static long com.google.protobuf.util.Durations.toMillis ( Duration  duration)
inlinestatic

Convert a Duration to the number of milliseconds. The result will be rounded towards 0 to the nearest millisecond. E.g., if the duration represents -1 nanosecond, it will be rounded to 0.

Definition at line 417 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ toMinutes() [1/2]

static long com.google.protobuf.util.Durations.toMinutes ( Duration  duration)
inlinestatic

Convert a Duration to the number of minutes. The result will be rounded towards 0 to the nearest minute.

Definition at line 357 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ toMinutes() [2/2]

static long com.google.protobuf.util.Durations.toMinutes ( Duration  duration)
inlinestatic

Convert a Duration to the number of minutes. The result will be rounded towards 0 to the nearest minute.

Definition at line 381 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ toNanos() [1/2]

static long com.google.protobuf.util.Durations.toNanos ( Duration  duration)
inlinestatic

Convert a Duration to the number of nanoseconds.

Definition at line 414 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ toNanos() [2/2]

static long com.google.protobuf.util.Durations.toNanos ( Duration  duration)
inlinestatic

Convert a Duration to the number of nanoseconds.

Definition at line 438 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ toSeconds() [1/2]

static long com.google.protobuf.util.Durations.toSeconds ( Duration  duration)
inlinestatic

Convert a Duration to the number of seconds. The result will be rounded towards 0 to the nearest second. E.g., if the duration represents -1 nanosecond, it will be rounded to 0.

Definition at line 366 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ toSeconds() [2/2]

static long com.google.protobuf.util.Durations.toSeconds ( Duration  duration)
inlinestatic

Convert a Duration to the number of seconds. The result will be rounded towards 0 to the nearest second. E.g., if the duration represents -1 nanosecond, it will be rounded to 0.

Definition at line 390 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ toSecondsAsDouble() [1/2]

static double com.google.protobuf.util.Durations.toSecondsAsDouble ( Duration  duration)
inlinestatic

Returns the number of seconds of the given duration as a

double

. This method should be used to accommodate APIs that only accept durations as

double

values.

This conversion may lose precision.

If you need the number of seconds in this duration as a

long

(not a

double

), simply use

duration.getSeconds()

or toSeconds (which includes validation).

Definition at line 383 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ toSecondsAsDouble() [2/2]

static double com.google.protobuf.util.Durations.toSecondsAsDouble ( Duration  duration)
inlinestatic

Returns the number of seconds of the given duration as a

double

. This method should be used to accommodate APIs that only accept durations as

double

values.

This conversion may lose precision.

If you need the number of seconds in this duration as a

long

(not a

double

), simply use

duration.getSeconds()

or toSeconds (which includes validation).

Definition at line 407 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ toString() [1/2]

static String com.google.protobuf.util.Durations.toString ( Duration  duration)
inlinestatic

Convert Duration to string format. The string format will contains 3, 6, or 9 fractional digits depending on the precision required to represent the exact Duration value. For example: "1s", "1.010s", "1.000000100s", "-3.100s" The range that can be represented by Duration is from -315,576,000,000 to +315,576,000,000 inclusive (in seconds).

Returns
The string representation of the given duration.
Exceptions
IllegalArgumentExceptionif the given duration is not in the valid range.

Definition at line 214 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ toString() [2/2]

static String com.google.protobuf.util.Durations.toString ( Duration  duration)
inlinestatic

Convert Duration to string format. The string format will contains 3, 6, or 9 fractional digits depending on the precision required to represent the exact Duration value. For example: "1s", "1.010s", "1.000000100s", "-3.100s" The range that can be represented by Duration is from -315,576,000,000 to +315,576,000,000 inclusive (in seconds).

Returns
The string representation of the given duration.
Exceptions
IllegalArgumentExceptionif the given duration is not in the valid range.

Definition at line 219 of file protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

Member Data Documentation

◆ COMPARATOR

final Comparator<Duration> com.google.protobuf.util.Durations.COMPARATOR
staticprivate
Initial value:
=
new Comparator<Duration>() {
@Override
public int compare(Duration d1, Duration d2) {
int secDiff = Long.compare(d1.getSeconds(), d2.getSeconds());
return (secDiff != 0) ? secDiff : Integer.compare(d1.getNanos(), d2.getNanos());
}
}

Definition at line 75 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ MAX_VALUE

static final Duration com.google.protobuf.util.Durations.MAX_VALUE
static
Initial value:
=
Duration.newBuilder().setSeconds(DURATION_SECONDS_MAX).setNanos(999999999).build()

A constant holding the maximum valid Duration, approximately

+10,000

years.

Definition at line 67 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ MIN_VALUE

static final Duration com.google.protobuf.util.Durations.MIN_VALUE
static
Initial value:
=
Duration.newBuilder().setSeconds(DURATION_SECONDS_MIN).setNanos(-999999999).build()

A constant holding the minimum valid Duration, approximately

-10,000

years.

Definition at line 63 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.

◆ SECONDS_PER_DAY

static final long com.google.protobuf.util.Durations.SECONDS_PER_DAY = SECONDS_PER_HOUR * 24
staticprivate

◆ SECONDS_PER_HOUR

static final long com.google.protobuf.util.Durations.SECONDS_PER_HOUR = SECONDS_PER_MINUTE * 60
staticprivate

◆ SECONDS_PER_MINUTE

static final long com.google.protobuf.util.Durations.SECONDS_PER_MINUTE = 60L
staticprivate

◆ ZERO

static final Duration com.google.protobuf.util.Durations.ZERO = Duration.newBuilder().setSeconds(0L).setNanos(0).build()
static

A constant holding the duration of zero.

Definition at line 71 of file bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java.


The documentation for this class was generated from the following file:
absl::time_internal::cctz::seconds
std::chrono::duration< std::int_fast64_t > seconds
Definition: abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h:40
y
const double y
Definition: bloaty/third_party/googletest/googlemock/test/gmock-matchers_test.cc:3611
google::protobuf
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:12
d2
static const fe d2
Definition: curve25519_tables.h:39
com.google.protobuf.util.Durations.Durations
Durations()
Definition: bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java:73
x
int x
Definition: bloaty/third_party/googletest/googlemock/test/gmock-matchers_test.cc:3610
com.google.protobuf.util.Durations.checkValid
static Duration checkValid(Duration duration)
Definition: bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java:180
com.google.protobuf.util.Durations.compare
static int compare(Duration x, Duration y)
Definition: bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java:101
com.google.protobuf.util.Durations.ZERO
static final Duration ZERO
Definition: bloaty/third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/Durations.java:71
Duration
Definition: bloaty/third_party/protobuf/src/google/protobuf/duration.pb.h:69


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:09