Interface ProxyInstant

All Superinterfaces:
Proxy, ProxyDate, ProxyTime, ProxyTimeZone

public interface ProxyInstant extends ProxyDate, ProxyTime, ProxyTimeZone
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:
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    default LocalDate
    Returns the date information.
    Returns the instant information.
    default LocalTime
    Returns the time information.
    default ZoneId
    Returns the timezone information.
    from(Instant instant)
    Creates a new proxy instant from a Java instant value.
  • Method Details Link icon

    • asInstant Link icon

      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
    • asDate Link icon

      default LocalDate asDate()
      Returns the date information. The returned value must not be null. The invariant specified in asInstant() must always hold for proxy instant values.
      Specified by:
      asDate in interface ProxyDate
      Since:
      19.2.0
      See Also:
    • asTime Link icon

      default LocalTime asTime()
      Returns the time information. The returned value must not be null. The invariant specified in asInstant() must always hold for proxy instant values.
      Specified by:
      asTime in interface ProxyTime
      Since:
      19.2.0
      See Also:
    • asTimeZone Link icon

      default ZoneId asTimeZone()
      Returns the timezone information. The returned value must not be null. The invariant specified in asInstant() must always hold for proxy instant values.
      Specified by:
      asTimeZone in interface ProxyTimeZone
      Since:
      19.2.0
      See Also:
    • from Link icon

      static ProxyInstant from(Instant instant)
      Creates a new proxy instant from a Java instant value.
      Since:
      19.2.0