Record Class BusinessHourSlot

java.lang.Object
java.lang.Record
one.cafebabe.businesscalendar4j.BusinessHourSlot
レコード・コンポーネント:
from - start time of the business hour slot
to - end time of the business hour slot
すべての実装されたインタフェース:
Serializable

public record BusinessHourSlot(@NotNull LocalDateTime from, @NotNull LocalDateTime to) extends Record implements Serializable
Represents a slot of business hours defined by a starting and ending time. This class is immutable and thread-safe, and it also implements the Serializable interface.

The time range is represented using LocalDateTime objects for both the from and to parameters. The BusinessHourSlot object can be constructed using either LocalDateTime or by providing a LocalDate along with LocalTime for starting and ending times.

The end time is adjusted to be on the next day if it represents the start of the next day (00:00).

関連項目:
  • コンストラクタの概要

    コンストラクタ
    コンストラクタ
    説明
    BusinessHourSlot(@NotNull LocalDateTime from, @NotNull LocalDateTime to)
    BusinessHourSlotレコードのインスタンスを作成します。
  • メソッドの概要

    修飾子とタイプ
    メソッド
    説明
    final boolean
    他のオブジェクトがこれと"等しい"かどうかを示します。
    @NotNull LocalDateTime
    fromレコード・コンポーネントの値が返されます。
    final int
    このオブジェクトのハッシュ・コード値を返します。
    @NotNull LocalDateTime
    to()
    toレコード・コンポーネントの値が返されます。
    final String
    このレコードの文字列表現を返します。

    クラスから継承されたメソッド java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • コンストラクタの詳細

    • BusinessHourSlot

      public BusinessHourSlot(@NotNull @NotNull LocalDateTime from, @NotNull @NotNull LocalDateTime to)
      BusinessHourSlotレコードのインスタンスを作成します。
      パラメータ:
      from - fromレコード・コンポーネントの値
      to - toレコード・コンポーネントの値
  • メソッドの詳細

    • toString

      public final String toString()
      このレコードの文字列表現を返します。表現には、型の名前に続けて各レコード・コンポーネントの名前と値が含まれます。
      定義:
      toString クラス内 Record
      戻り値:
      このオブジェクトの文字列表現
    • hashCode

      public final int hashCode()
      このオブジェクトのハッシュ・コード値を返します。値は、各レコード・コンポーネントのハッシュ・コードから導出されます。
      定義:
      hashCode クラス内 Record
      戻り値:
      このオブジェクトのハッシュ・コード値
    • equals

      public final boolean equals(Object o)
      他のオブジェクトがこれと"等しい"かどうかを示します。他のオブジェクトが同じクラスであり、すべてのレコード・コンポーネントが等しい場合、オブジェクトは等しくなります。 このレコード内のすべてのコンポーネントはObjects::equals(Object,Object)と比較されます。
      定義:
      equals クラス内 Record
      パラメータ:
      o - 比較するオブジェクト
      戻り値:
      このオブジェクトがo引数と同じである場合はtrue、それ以外の場合はfalse
    • from

      @NotNull public @NotNull LocalDateTime from()
      fromレコード・コンポーネントの値が返されます。
      戻り値:
      fromレコード・コンポーネントの値
    • to

      @NotNull public @NotNull LocalDateTime to()
      toレコード・コンポーネントの値が返されます。
      戻り値:
      toレコード・コンポーネントの値