Record Class BusinessProfile

java.lang.Object
java.lang.Record
it.auties.whatsapp.model.business.BusinessProfile

public record BusinessProfile(Jid jid, Optional<String> description, Optional<String> address, Optional<String> email, Optional<BusinessHours> hours, boolean cartEnabled, List<URI> websites, List<BusinessCategory> categories) extends Record
This model class represents the metadata of a business profile
  • Field Details

    • jid

      private final Jid jid
      The field for the jid record component.
    • description

      private final Optional<String> description
      The field for the description record component.
    • address

      private final Optional<String> address
      The field for the address record component.
    • email

      private final Optional<String> email
      The field for the email record component.
    • hours

      private final Optional<BusinessHours> hours
      The field for the hours record component.
    • cartEnabled

      private final boolean cartEnabled
      The field for the cartEnabled record component.
    • websites

      private final List<URI> websites
      The field for the websites record component.
    • categories

      private final List<BusinessCategory> categories
      The field for the categories record component.
  • Constructor Details

    • BusinessProfile

      public BusinessProfile(Jid jid, Optional<String> description, Optional<String> address, Optional<String> email, Optional<BusinessHours> hours, boolean cartEnabled, List<URI> websites, List<BusinessCategory> categories)
      Creates an instance of a BusinessProfile record class.
      Parameters:
      jid - the value for the jid record component
      description - the value for the description record component
      address - the value for the address record component
      email - the value for the email record component
      hours - the value for the hours record component
      cartEnabled - the value for the cartEnabled record component
      websites - the value for the websites record component
      categories - the value for the categories record component
  • Method Details

    • of

      public static BusinessProfile of(Node node)
      Constructs a new profile from a node
      Parameters:
      node - a non-null node
      Returns:
      a non-null profile
    • createHours

      private static Optional<BusinessHours> createHours(Node node)
    • 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.
    • jid

      public Jid jid()
      Returns the value of the jid record component.
      Returns:
      the value of the jid record component
    • description

      public Optional<String> description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component
    • address

      public Optional<String> address()
      Returns the value of the address record component.
      Returns:
      the value of the address record component
    • email

      public Optional<String> email()
      Returns the value of the email record component.
      Returns:
      the value of the email record component
    • hours

      public Optional<BusinessHours> hours()
      Returns the value of the hours record component.
      Returns:
      the value of the hours record component
    • cartEnabled

      public boolean cartEnabled()
      Returns the value of the cartEnabled record component.
      Returns:
      the value of the cartEnabled record component
    • websites

      public List<URI> websites()
      Returns the value of the websites record component.
      Returns:
      the value of the websites record component
    • categories

      public List<BusinessCategory> categories()
      Returns the value of the categories record component.
      Returns:
      the value of the categories record component