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 Summary
FieldsModifier and TypeFieldDescriptionThe field for theaddressrecord component.private final booleanThe field for thecartEnabledrecord component.private final List<BusinessCategory> The field for thecategoriesrecord component.The field for thedescriptionrecord component.The field for theemailrecord component.private final Optional<BusinessHours> The field for thehoursrecord component.private final JidThe field for thejidrecord component.The field for thewebsitesrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionBusinessProfile(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 aBusinessProfilerecord class. -
Method Summary
Modifier and TypeMethodDescriptionaddress()Returns the value of theaddressrecord component.booleanReturns the value of thecartEnabledrecord component.Returns the value of thecategoriesrecord component.private static Optional<BusinessHours> createHours(Node node) Returns the value of thedescriptionrecord component.email()Returns the value of theemailrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.hours()Returns the value of thehoursrecord component.jid()Returns the value of thejidrecord component.static BusinessProfileConstructs a new profile from a nodefinal StringtoString()Returns a string representation of this record class.websites()Returns the value of thewebsitesrecord component.
-
Field Details
-
jid
The field for thejidrecord component. -
description
The field for thedescriptionrecord component. -
address
The field for theaddressrecord component. -
email
The field for theemailrecord component. -
hours
The field for thehoursrecord component. -
cartEnabled
private final boolean cartEnabledThe field for thecartEnabledrecord component. -
websites
The field for thewebsitesrecord component. -
categories
The field for thecategoriesrecord 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 aBusinessProfilerecord class.- Parameters:
jid- the value for thejidrecord componentdescription- the value for thedescriptionrecord componentaddress- the value for theaddressrecord componentemail- the value for theemailrecord componenthours- the value for thehoursrecord componentcartEnabled- the value for thecartEnabledrecord componentwebsites- the value for thewebsitesrecord componentcategories- the value for thecategoriesrecord component
-
-
Method Details
-
of
Constructs a new profile from a node- Parameters:
node- a non-null node- Returns:
- a non-null profile
-
createHours
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
jid
Returns the value of thejidrecord component.- Returns:
- the value of the
jidrecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
address
Returns the value of theaddressrecord component.- Returns:
- the value of the
addressrecord component
-
email
Returns the value of theemailrecord component.- Returns:
- the value of the
emailrecord component
-
hours
Returns the value of thehoursrecord component.- Returns:
- the value of the
hoursrecord component
-
cartEnabled
public boolean cartEnabled()Returns the value of thecartEnabledrecord component.- Returns:
- the value of the
cartEnabledrecord component
-
websites
Returns the value of thewebsitesrecord component.- Returns:
- the value of the
websitesrecord component
-
categories
Returns the value of thecategoriesrecord component.- Returns:
- the value of the
categoriesrecord component
-