Module it.auties.cobalt
Record Class HighlyStructuredDateTime
java.lang.Object
java.lang.Record
it.auties.whatsapp.model.button.template.highlyStructured.HighlyStructuredDateTime
- All Implemented Interfaces:
it.auties.protobuf.model.ProtobufMessage,it.auties.protobuf.model.ProtobufObject,HighlyStructuredLocalizableParameterValue
public record HighlyStructuredDateTime(Optional<HighlyStructuredDateTimeComponent> dateComponent, Optional<HighlyStructuredDateTimeUnixEpoch> dateUnixEpoch)
extends Record
implements HighlyStructuredLocalizableParameterValue
A model class that represents a time
-
Nested Class Summary
Nested classes/interfaces inherited from interface it.auties.whatsapp.model.button.template.highlyStructured.HighlyStructuredLocalizableParameterValue
HighlyStructuredLocalizableParameterValue.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Optional<HighlyStructuredDateTimeComponent> The field for thedateComponentrecord component.private final Optional<HighlyStructuredDateTimeUnixEpoch> The field for thedateUnixEpochrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionHighlyStructuredDateTime(Optional<HighlyStructuredDateTimeComponent> dateComponent, Optional<HighlyStructuredDateTimeUnixEpoch> dateUnixEpoch) Creates an instance of aHighlyStructuredDateTimerecord class. -
Method Summary
Modifier and TypeMethodDescriptionOptional<? extends HighlyStructuredDateTimeValue> date()Returns the date of this componentReturns the value of thedateComponentrecord component.dateType()Returns the type of date of this componentReturns the value of thedateUnixEpochrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static HighlyStructuredDateTimeof(HighlyStructuredDateTimeValue dateComponent) Constructs a new date time using a componentReturns the type of parameterfinal StringtoString()Returns a string representation of this record class.
-
Field Details
-
dateComponent
The field for thedateComponentrecord component. -
dateUnixEpoch
The field for thedateUnixEpochrecord component.
-
-
Constructor Details
-
HighlyStructuredDateTime
public HighlyStructuredDateTime(Optional<HighlyStructuredDateTimeComponent> dateComponent, Optional<HighlyStructuredDateTimeUnixEpoch> dateUnixEpoch) Creates an instance of aHighlyStructuredDateTimerecord class.- Parameters:
dateComponent- the value for thedateComponentrecord componentdateUnixEpoch- the value for thedateUnixEpochrecord component
-
-
Method Details
-
of
Constructs a new date time using a component- Parameters:
dateComponent- the non-null component- Returns:
- a non-null date time
-
dateType
Returns the type of date of this component- Returns:
- a non-null date type
-
date
Returns the date of this component- Returns:
- a non-null date type
-
parameterType
Description copied from interface:HighlyStructuredLocalizableParameterValueReturns the type of parameter- Specified by:
parameterTypein interfaceHighlyStructuredLocalizableParameterValue- Returns:
- a non-null type
-
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). -
dateComponent
Returns the value of thedateComponentrecord component.- Returns:
- the value of the
dateComponentrecord component
-
dateUnixEpoch
Returns the value of thedateUnixEpochrecord component.- Returns:
- the value of the
dateUnixEpochrecord component
-