java.lang.Object
java.lang.Record
it.auties.whatsapp.model.button.base.Button
- All Implemented Interfaces:
it.auties.protobuf.model.ProtobufMessage,it.auties.protobuf.model.ProtobufObject
public record Button(String id, Optional<ButtonText> bodyText, Optional<NativeFlowInfo> bodyNativeFlow, ButtonBody.Type bodyType)
extends Record
implements it.auties.protobuf.model.ProtobufMessage
A model class that represents a button
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Optional<NativeFlowInfo> The field for thebodyNativeFlowrecord component.private final Optional<ButtonText> The field for thebodyTextrecord component.private final ButtonBody.TypeThe field for thebodyTyperecord component.private final StringThe field for theidrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionButton(String id, Optional<ButtonText> bodyText, Optional<NativeFlowInfo> bodyNativeFlow, ButtonBody.Type bodyType) Creates an instance of aButtonrecord class. -
Method Summary
Modifier and TypeMethodDescriptionOptional<? extends ButtonBody> body()Returns the body of this buttonReturns the value of thebodyNativeFlowrecord component.bodyText()Returns the value of thebodyTextrecord component.bodyType()Returns the value of thebodyTyperecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.static Buttonof(ButtonBody body) Constructs a new buttonstatic Buttonof(String id, ButtonBody body) Constructs a new buttonfinal StringtoString()Returns a string representation of this record class.
-
Field Details
-
id
The field for theidrecord component. -
bodyText
The field for thebodyTextrecord component. -
bodyNativeFlow
The field for thebodyNativeFlowrecord component. -
bodyType
The field for thebodyTyperecord component.
-
-
Constructor Details
-
Button
public Button(String id, Optional<ButtonText> bodyText, Optional<NativeFlowInfo> bodyNativeFlow, ButtonBody.Type bodyType) Creates an instance of aButtonrecord class.- Parameters:
id- the value for theidrecord componentbodyText- the value for thebodyTextrecord componentbodyNativeFlow- the value for thebodyNativeFlowrecord componentbodyType- the value for thebodyTyperecord component
-
-
Method Details
-
of
Constructs a new button- Parameters:
body- the body of this button- Returns:
- a non-null button
-
of
Constructs a new button- Parameters:
id- the non-null id of the buttonbody- the body of this button- Returns:
- a non-null button
-
body
Returns the body of this button- Returns:
- an optional
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
bodyText
Returns the value of thebodyTextrecord component.- Returns:
- the value of the
bodyTextrecord component
-
bodyNativeFlow
Returns the value of thebodyNativeFlowrecord component.- Returns:
- the value of the
bodyNativeFlowrecord component
-
bodyType
Returns the value of thebodyTyperecord component.- Returns:
- the value of the
bodyTyperecord component
-