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

    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

    • asInstant

      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

      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

      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

      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

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