Record Class BusinessHoursEntry

java.lang.Object
java.lang.Record
it.auties.whatsapp.model.business.BusinessHoursEntry
Record Components:
day - The day of the week that this entry represents.
mode - The mode of operation for this day.
openTime - The time in seconds since midnight that the business opens.
closeTime - The time in seconds since midnight that the business closes.

public record BusinessHoursEntry(String day, String mode, long openTime, long closeTime) extends Record
A business hours entry that represents the hours of operation for a single day of the week.
  • Field Details

    • day

      private final String day
      The field for the day record component.
    • mode

      private final String mode
      The field for the mode record component.
    • openTime

      private final long openTime
      The field for the openTime record component.
    • closeTime

      private final long closeTime
      The field for the closeTime record component.
  • Constructor Details

    • BusinessHoursEntry

      public BusinessHoursEntry(String day, String mode, long openTime, long closeTime)
      Creates an instance of a BusinessHoursEntry record class.
      Parameters:
      day - the value for the day record component
      mode - the value for the mode record component
      openTime - the value for the openTime record component
      closeTime - the value for the closeTime record component
  • Method Details

    • of

      public static BusinessHoursEntry of(Node node)
      Creates a BusinessHoursEntry from a Node.
      Parameters:
      node - The node to extract the business hours entry information from.
      Returns:
      A BusinessHoursEntry extracted from the provided node.
    • isAlwaysOpen

      public boolean isAlwaysOpen()
      Returns whether the business is always open.
      Returns:
      whether the business is always open
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • day

      public String day()
      Returns the value of the day record component.
      Returns:
      the value of the day record component
    • mode

      public String mode()
      Returns the value of the mode record component.
      Returns:
      the value of the mode record component
    • openTime

      public long openTime()
      Returns the value of the openTime record component.
      Returns:
      the value of the openTime record component
    • closeTime

      public long closeTime()
      Returns the value of the closeTime record component.
      Returns:
      the value of the closeTime record component