Interface DurationOrBuilder (1.17.0)

public interface DurationOrBuilder extends MessageOrBuilder

Implements

MessageOrBuilder

Methods

getNanos()

public abstract int getNanos()

Span of time that's a fraction of a second at nanosecond resolution. Durations less than one second are represented with a 0 seconds field and a positive nanos field. Must be from 0 to 999,999,999 inclusive.

optional int32 nanos = 104586303;

Returns
TypeDescription
int

The nanos.

getSeconds()

public abstract long getSeconds()

Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 inclusive. Note: these bounds are computed from: 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years

optional int64 seconds = 359484031;

Returns
TypeDescription
long

The seconds.

hasNanos()

public abstract boolean hasNanos()

Span of time that's a fraction of a second at nanosecond resolution. Durations less than one second are represented with a 0 seconds field and a positive nanos field. Must be from 0 to 999,999,999 inclusive.

optional int32 nanos = 104586303;

Returns
TypeDescription
boolean

Whether the nanos field is set.

hasSeconds()

public abstract boolean hasSeconds()

Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 inclusive. Note: these bounds are computed from: 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years

optional int64 seconds = 359484031;

Returns
TypeDescription
boolean

Whether the seconds field is set.