public interface

DynamicBuilders.DynamicInstant

implements DynamicBuilders.DynamicType

 androidx.wear.protolayout.expression.DynamicBuilders.DynamicInstant

Overview

Interface defining a dynamic time instant type.

DynamicBuilders.DynamicInstant precision is seconds. Thus, any time or duration operation will operate on that precision level.

Summary

Methods
public androidx.wear.protolayout.expression.DynamicBuilders.DynamicZonedDateTimeatZone(java.time.ZoneId zoneId)

Returns a instance representing this Instant in the specified time-zone.

public DynamicBuilders.DynamicDurationdurationUntil(DynamicBuilders.DynamicInstant to)

Returns duration between the two DynamicBuilders.DynamicInstant instances as a DynamicBuilders.DynamicDuration.

public static DynamicBuilders.DynamicInstantfrom(DynamicDataKey<DynamicBuilders.DynamicInstant> dynamicDataKey)

Creates a DynamicBuilders.DynamicInstant that is bound to the value of an item of the State.

public static DynamicBuilders.DynamicInstantfromByteArray(byte[] byteArray[])

Creates a DynamicBuilders.DynamicInstant from a byte array generated by DynamicBuilders.DynamicInstant.toDynamicInstantByteArray().

public static DynamicBuilders.DynamicInstantfromByteArray(byte[] byteArray[], int offset, int length)

Creates a DynamicBuilders.DynamicInstant from the provided byte array at the provided offset and length, that was generated by one of the DynamicBuilders.DynamicInstant.toDynamicInstantByteArray() overloads.

public DynamicBuilders.DynamicInt32getDayOfMonth(java.time.ZoneId zoneId)

Returns the day-of-month field from 1 to 31 following the ISO-8601 calendar system; As an example, the following is equal to DynamicInt32.constant(1):

public DynamicBuilders.DynamicInt32getDayOfWeek(java.time.ZoneId zoneId)

Returns the day-of-week field going from MONDAY (1) to SUNDAY (7) following the ISO-8601 calendar system; As an example, the following is equal to DynamicInt32.constant(4):

public FingerprintgetFingerprint()

Get the fingerprint for this object or null if unknown.

public DynamicBuilders.DynamicInt32getHour(java.time.ZoneId zoneId)

Returns the hour-of-day field from 0 to 23 following the ISO-8601 calendar system; As an example, the following is equal to DynamicInt32.constant(3):

public DynamicBuilders.DynamicInt32getMinute(java.time.ZoneId zoneId)

Returns the minute-of-hour field from 0 to 59 following the ISO-8601 calendar system; As an example, the following is equal to DynamicInt32.constant(20):

public DynamicBuilders.DynamicInt32getMonth(java.time.ZoneId zoneId)

Returns the month-of-year field from 1 to 12 following the ISO-8601 calendar system; As an example, the following is equal to DynamicInt32.constant(1):

public DynamicBuilders.DynamicInt32getSecond(java.time.ZoneId zoneId)

Returns the second-of-minute field from 0 to 59 following the ISO-8601 calendar system; As an example, the following is equal to DynamicInt32.constant(10):

public DynamicBuilders.DynamicInt32getYear(java.time.ZoneId zoneId)

Returns the year field following the ISO-8601 calendar system; As an example, the following is equal to DynamicInt32.constant(1970):

public static ConditionScopes.ConditionScope<DynamicBuilders.DynamicInstant, java.time.Instant>onCondition(DynamicBuilders.DynamicBool condition)

Bind the value of this DynamicBuilders.DynamicInstant to the result of a conditional expression.

public static DynamicBuilders.DynamicInstantplatformTimeWithSecondsPrecision()

Creates a DynamicBuilders.DynamicInstant that updates its value periodically from the system time.

public byte[]toDynamicInstantByteArray()

Serializes the DynamicBuilders.DynamicInstant into a new byte array that can later be used with DynamicBuilders.DynamicInstant.fromByteArray(byte[]).

public inttoDynamicInstantByteArray(byte[] byteArray[])

Serializes the DynamicBuilders.DynamicInstant into the provided byte array, returning the amount of bytes written, that can later be used with DynamicInstant.fromByteArray( byteArray, 0, bytesWritten).

public inttoDynamicInstantByteArray(byte[] byteArray[], int offset, int length)

Serializes the DynamicBuilders.DynamicInstant into the provided byte array, returning the amount of bytes written, limited by the provided offset and length, that can later be used with DynamicInstant.fromByteArray(byteArray, offset, bytesWritten).

public DynamicProto.DynamicInstanttoDynamicInstantProto()

Get the protocol buffer representation of this object, without fingerprint.

public DynamicProto.DynamicInstanttoDynamicInstantProto(boolean withFingerprint)

Get the protocol buffer representation of this object, with or without fingerprint.

public static DynamicBuilders.DynamicInstantwithSecondsPrecision(java.time.Instant instant)

Creates a constant-valued DynamicBuilders.DynamicInstant from an java.time.Instant.

Methods

public DynamicProto.DynamicInstant toDynamicInstantProto()

Get the protocol buffer representation of this object, without fingerprint.

public DynamicProto.DynamicInstant toDynamicInstantProto(boolean withFingerprint)

Get the protocol buffer representation of this object, with or without fingerprint.

public static DynamicBuilders.DynamicInstant fromByteArray(byte[] byteArray[])

Creates a DynamicBuilders.DynamicInstant from a byte array generated by DynamicBuilders.DynamicInstant.toDynamicInstantByteArray().

public static DynamicBuilders.DynamicInstant fromByteArray(byte[] byteArray[], int offset, int length)

Creates a DynamicBuilders.DynamicInstant from the provided byte array at the provided offset and length, that was generated by one of the DynamicBuilders.DynamicInstant.toDynamicInstantByteArray() overloads.

public byte[] toDynamicInstantByteArray()

Serializes the DynamicBuilders.DynamicInstant into a new byte array that can later be used with DynamicBuilders.DynamicInstant.fromByteArray(byte[]).

public int toDynamicInstantByteArray(byte[] byteArray[])

Serializes the DynamicBuilders.DynamicInstant into the provided byte array, returning the amount of bytes written, that can later be used with DynamicInstant.fromByteArray( byteArray, 0, bytesWritten).

public int toDynamicInstantByteArray(byte[] byteArray[], int offset, int length)

Serializes the DynamicBuilders.DynamicInstant into the provided byte array, returning the amount of bytes written, limited by the provided offset and length, that can later be used with DynamicInstant.fromByteArray(byteArray, offset, bytesWritten).

public static DynamicBuilders.DynamicInstant from(DynamicDataKey<DynamicBuilders.DynamicInstant> dynamicDataKey)

Creates a DynamicBuilders.DynamicInstant that is bound to the value of an item of the State.

Parameters:

dynamicDataKey: The source key to a DynamicDataBuilders.DynamicDataValue with an java.time.Instant value.

public static DynamicBuilders.DynamicInstant withSecondsPrecision(java.time.Instant instant)

Creates a constant-valued DynamicBuilders.DynamicInstant from an java.time.Instant. If java.time.Instant precision is greater than seconds, then any excess precision information will be dropped.

public static DynamicBuilders.DynamicInstant platformTimeWithSecondsPrecision()

Creates a DynamicBuilders.DynamicInstant that updates its value periodically from the system time.

Returns duration between the two DynamicBuilders.DynamicInstant instances as a DynamicBuilders.DynamicDuration. The resulted duration is inclusive of the start instant and exclusive of the end; As an example, the following expression yields a duration object representing 10 seconds:

   DynamicInstant.withSecondsPrecision(Instant.ofEpochSecond(10L))
      .durationUntil(DynamicInstant.withSecondsPrecision(Instant.ofEpochSecond(20L)));
 

Returns:

a new instance of DynamicBuilders.DynamicDuration containing the result of the operation.

public DynamicBuilders.DynamicInt32 getYear(java.time.ZoneId zoneId)

Returns the year field following the ISO-8601 calendar system; As an example, the following is equal to DynamicInt32.constant(1970):

   DynamicInstant.withSecondsPrecision(Instant.ofEpochSecond(8410))
      .getYear(ZoneId.of("Europe/London"));
 

public DynamicBuilders.DynamicInt32 getMonth(java.time.ZoneId zoneId)

Returns the month-of-year field from 1 to 12 following the ISO-8601 calendar system; As an example, the following is equal to DynamicInt32.constant(1):

   DynamicInstant.withSecondsPrecision(Instant.ofEpochSecond(8410))
      .getMonth(ZoneId.of("Europe/London"));
 

public DynamicBuilders.DynamicInt32 getDayOfMonth(java.time.ZoneId zoneId)

Returns the day-of-month field from 1 to 31 following the ISO-8601 calendar system; As an example, the following is equal to DynamicInt32.constant(1):

   DynamicInstant.withSecondsPrecision(Instant.ofEpochSecond(8410))
      .getDayOfMonth(ZoneId.of("Europe/London"));
 

public DynamicBuilders.DynamicInt32 getDayOfWeek(java.time.ZoneId zoneId)

Returns the day-of-week field going from MONDAY (1) to SUNDAY (7) following the ISO-8601 calendar system; As an example, the following is equal to DynamicInt32.constant(4):

   DynamicInstant.withSecondsPrecision(Instant.ofEpochSecond(8410))
      .getDayOfWeek(ZoneId.of("Europe/London"));
 

public DynamicBuilders.DynamicInt32 getHour(java.time.ZoneId zoneId)

Returns the hour-of-day field from 0 to 23 following the ISO-8601 calendar system; As an example, the following is equal to DynamicInt32.constant(3):

   DynamicInstant.withSecondsPrecision(Instant.ofEpochSecond(8410))
      .getHour(ZoneId.of("Europe/London"));
 

public DynamicBuilders.DynamicInt32 getMinute(java.time.ZoneId zoneId)

Returns the minute-of-hour field from 0 to 59 following the ISO-8601 calendar system; As an example, the following is equal to DynamicInt32.constant(20):

   DynamicInstant.withSecondsPrecision(Instant.ofEpochSecond(8410))
      .getMinute(ZoneId.of("Europe/London"));
 

public DynamicBuilders.DynamicInt32 getSecond(java.time.ZoneId zoneId)

Returns the second-of-minute field from 0 to 59 following the ISO-8601 calendar system; As an example, the following is equal to DynamicInt32.constant(10):

   DynamicInstant.withSecondsPrecision(Instant.ofEpochSecond(8410))
      .getSecond(ZoneId.of("Europe/London"));
 

public androidx.wear.protolayout.expression.DynamicBuilders.DynamicZonedDateTime atZone(java.time.ZoneId zoneId)

Returns a instance representing this Instant in the specified time-zone. As an example, the following expression yields a instance representing platform time in Europe/London time-zone:

   DynamicInstant.platformTimeWithSecondsPrecision()
      .atZone(ZoneId.of("Europe/London"));
 

Returns:

a new instance of representing this DynamicBuilders.DynamicInstant in the specified time-zone.

public static ConditionScopes.ConditionScope<DynamicBuilders.DynamicInstant, java.time.Instant> onCondition(DynamicBuilders.DynamicBool condition)

Bind the value of this DynamicBuilders.DynamicInstant to the result of a conditional expression. This will use the value given in either ConditionScopes.ConditionScope.use(T) or ConditionScopes.IfTrueScope.elseUse(T) depending on the value yielded from condition.

public Fingerprint getFingerprint()

Get the fingerprint for this object or null if unknown.