Record Class SDL_DateTime

java.lang.Object
java.lang.Record
club.doki7.sdl3.datatype.SDL_DateTime
All Implemented Interfaces:
IPointer, ISDL_DateTime

@ValueBasedCandidate @UnsafeConstructor public record SDL_DateTime(@NotNull MemorySegment segment) extends Record implements ISDL_DateTime

A structure holding a calendar date and time broken down into its components.

Since: This struct is available since SDL 3.2.0.

Structure

typedef struct SDL_DateTime {
    int year;
    int month;
    int day;
    int hour;
    int minute;
    int second;
    int nanosecond;
    int day_of_week;
    int utc_offset;
} SDL_DateTime;

Contracts

The property segment() should always be not-null (segment != NULL && !segment.equals(MemorySegment.NULL)), and properly aligned to LAYOUT.byteAlignment() bytes. To represent null pointer, you may use a Java null instead. See the documentation of IPointer.segment() for more details.

The constructor of this class is marked as UnsafeConstructor, because it does not perform any runtime check. The constructor can be useful for automatic code generators.

  • Field Details

    • LAYOUT

      public static final StructLayout LAYOUT
    • BYTES

      public static final long BYTES
    • PATH$year

      public static final MemoryLayout.PathElement PATH$year
    • PATH$month

      public static final MemoryLayout.PathElement PATH$month
    • PATH$day

      public static final MemoryLayout.PathElement PATH$day
    • PATH$hour

      public static final MemoryLayout.PathElement PATH$hour
    • PATH$minute

      public static final MemoryLayout.PathElement PATH$minute
    • PATH$second

      public static final MemoryLayout.PathElement PATH$second
    • PATH$nanosecond

      public static final MemoryLayout.PathElement PATH$nanosecond
    • PATH$day_of_week

      public static final MemoryLayout.PathElement PATH$day_of_week
    • PATH$utc_offset

      public static final MemoryLayout.PathElement PATH$utc_offset
    • LAYOUT$year

      public static final ValueLayout.OfInt LAYOUT$year
    • LAYOUT$month

      public static final ValueLayout.OfInt LAYOUT$month
    • LAYOUT$day

      public static final ValueLayout.OfInt LAYOUT$day
    • LAYOUT$hour

      public static final ValueLayout.OfInt LAYOUT$hour
    • LAYOUT$minute

      public static final ValueLayout.OfInt LAYOUT$minute
    • LAYOUT$second

      public static final ValueLayout.OfInt LAYOUT$second
    • LAYOUT$nanosecond

      public static final ValueLayout.OfInt LAYOUT$nanosecond
    • LAYOUT$day_of_week

      public static final ValueLayout.OfInt LAYOUT$day_of_week
    • LAYOUT$utc_offset

      public static final ValueLayout.OfInt LAYOUT$utc_offset
    • SIZE$year

      public static final long SIZE$year
    • SIZE$month

      public static final long SIZE$month
    • SIZE$day

      public static final long SIZE$day
    • SIZE$hour

      public static final long SIZE$hour
    • SIZE$minute

      public static final long SIZE$minute
    • SIZE$second

      public static final long SIZE$second
    • SIZE$nanosecond

      public static final long SIZE$nanosecond
    • SIZE$day_of_week

      public static final long SIZE$day_of_week
    • SIZE$utc_offset

      public static final long SIZE$utc_offset
    • OFFSET$year

      public static final long OFFSET$year
    • OFFSET$month

      public static final long OFFSET$month
    • OFFSET$day

      public static final long OFFSET$day
    • OFFSET$hour

      public static final long OFFSET$hour
    • OFFSET$minute

      public static final long OFFSET$minute
    • OFFSET$second

      public static final long OFFSET$second
    • OFFSET$nanosecond

      public static final long OFFSET$nanosecond
    • OFFSET$day_of_week

      public static final long OFFSET$day_of_week
    • OFFSET$utc_offset

      public static final long OFFSET$utc_offset
  • Constructor Details

    • SDL_DateTime

      public SDL_DateTime(@NotNull @NotNull MemorySegment segment)
      Creates an instance of a SDL_DateTime record class.
      Parameters:
      segment - the value for the segment record component
  • Method Details

    • allocate

      public static SDL_DateTime allocate(Arena arena)
    • allocate

      public static SDL_DateTime.Ptr allocate(Arena arena, long count)
    • clone

      public static SDL_DateTime clone(Arena arena, SDL_DateTime src)
    • year

      public int year()
    • year

      public SDL_DateTime year(int value)
    • month

      public int month()
    • month

      public SDL_DateTime month(int value)
    • day

      public int day()
    • day

      public SDL_DateTime day(int value)
    • hour

      public int hour()
    • hour

      public SDL_DateTime hour(int value)
    • minute

      public int minute()
    • minute

      public SDL_DateTime minute(int value)
    • second

      public int second()
    • second

      public SDL_DateTime second(int value)
    • nanosecond

      public int nanosecond()
    • nanosecond

      public SDL_DateTime nanosecond(int value)
    • day_of_week

      public int day_of_week()
    • day_of_week

      public SDL_DateTime day_of_week(int value)
    • utc_offset

      public int utc_offset()
    • utc_offset

      public SDL_DateTime utc_offset(int value)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • segment

      @NotNull public @NotNull MemorySegment segment()
      Returns the value of the segment record component.
      Specified by:
      segment in interface IPointer
      Returns:
      the value of the segment record component