Top Description Methods
org.graalvm.polyglot.proxy

public Interface ProxyInstant

Additional top-level class in compilation unit: ProxyInstantConstants.

extends ProxyDate, ProxyTime, ProxyTimeZone
Imports
java.time.Instant, .LocalDate, .LocalTime, .ZoneId, java.util.Objects, org.graalvm.polyglot.Value

Interface to be implemented to mimic guest language objects that represents timestamps. This interface also implements ProxyDate, ProxyTime and ProxyTimeZone.
Since
19.2.0
See Also
Proxy, Value

Method Summary

Modifier and TypeMethod and Description
public default LocalDate
asDate()

Implements org.graalvm.polyglot.proxy.ProxyDate.asDate.

Returns the date information.

public Instant
asInstant()

Returns the instant information.

public default LocalTime
asTime()

Implements org.graalvm.polyglot.proxy.ProxyTime.asTime.

Returns the time information.

public default ZoneId
asTimeZone()

Implements org.graalvm.polyglot.proxy.ProxyTimeZone.asTimeZone.

Returns the timezone information.

public static ProxyInstant
from(Instant instant)

Creates a new proxy instant from a Java instant value.

Inherited from org.graalvm.polyglot.proxy.ProxyDate:
from
Inherited from org.graalvm.polyglot.proxy.ProxyTime:
from
Inherited from org.graalvm.polyglot.proxy.ProxyTimeZone:
from

Method Detail

asDateback to summary
public default LocalDate asDate()

Implements org.graalvm.polyglot.proxy.ProxyDate.asDate.

Doc from org.graalvm.polyglot.proxy.ProxyDate.asDate.

Returns the date information. The returned value must not be null. The invariant specified in asInstant() must always hold for proxy instant values.

Since
19.2.0
See Also
asInstant()
asInstantback to summary
public Instant asInstant()

Returns the instant information. The returned value must not be null. The following invariant must always hold for instant proxies:

ProxyInstant proxy = ...
ZoneId zone = proxy.getTimeZone();
LocalDate date = proxy.getDate();
LocalTime time = proxy.getTime();
assert ZonedDateTime.of(date, time, zone).equals(proxy.getInstant());
Since
19.2.0
asTimeback to summary
public default LocalTime asTime()

Implements org.graalvm.polyglot.proxy.ProxyTime.asTime.

Doc from org.graalvm.polyglot.proxy.ProxyTime.asTime.

Returns the time information. The returned value must not be null. The invariant specified in asInstant() must always hold for proxy instant values.

Since
19.2.0
See Also
asInstant()
asTimeZoneback to summary
public default ZoneId asTimeZone()

Implements org.graalvm.polyglot.proxy.ProxyTimeZone.asTimeZone.

Doc from org.graalvm.polyglot.proxy.ProxyTimeZone.asTimeZone.

Returns the timezone information. The returned value must not be null. The invariant specified in asInstant() must always hold for proxy instant values.

Since
19.2.0
See Also
asInstant()
fromback to summary
public static ProxyInstant from(Instant instant)

Creates a new proxy instant from a Java instant value.

Since
19.2.0