java.lang.Object
java.lang.Record
it.auties.whatsapp.model.chat.ChatMute
- Record Components:
endTimeStamp
- the end date of the mute associated with this object stored as second sinceInstant.EPOCH
- All Implemented Interfaces:
it.auties.protobuf.api.model.ProtobufMessage
public record ChatMute(long endTimeStamp)
extends Record
implements it.auties.protobuf.api.model.ProtobufMessage
An immutable model class that represents a mute
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The constants of this enumerated type describe the various types of mute aChatMute
can describe -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionend()
Returns the date when this mute expires if the chat is muted and not indefinitelylong
Returns the value of theendTimeStamp
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
isMuted()
Returns whether the chat associated with this object is muted or not.static ChatMute
muted()
Constructs a new muted ChatMutestatic ChatMute
Constructs a new mute for a duration in endTimeStampstatic ChatMute
Constructs a new mute that lasts eight hoursstatic ChatMute
Constructs a new mute that lasts one weekstatic ChatMute
notMuted()
Constructs a new not muted ChatMutefinal String
toString()
Returns a string representation of this record class.type()
Returns a non-null enum that describes the type of mute for this objectvalue()
-
Constructor Details
-
ChatMute
public ChatMute(long endTimeStamp) Creates an instance of aChatMute
record class.- Parameters:
endTimeStamp
- the value for theendTimeStamp
record component
-
-
Method Details
-
notMuted
Constructs a new not muted ChatMute- Returns:
- a non-null mute
-
muted
Constructs a new muted ChatMute- Returns:
- a non-null mute
-
mutedForEightHours
Constructs a new mute that lasts eight hours- Returns:
- a non-null mute
-
mutedForOneWeek
Constructs a new mute that lasts one week- Returns:
- a non-null mute
-
muted
Constructs a new mute for a duration in endTimeStamp- Parameters:
seconds
- can be null and is considered as not muted- Returns:
- a non-null mute
-
isMuted
public boolean isMuted()Returns whether the chat associated with this object is muted or not.- Returns:
- true if the chat associated with this object is muted
-
type
Returns a non-null enum that describes the type of mute for this object- Returns:
- a non-null enum that describes the type of mute for this object
-
end
Returns the date when this mute expires if the chat is muted and not indefinitely- Returns:
- a non-empty optional date if
endTimeStamp
> 0
-
value
- Specified by:
value
in interfaceit.auties.protobuf.api.model.ProtobufMessage
-
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 with '=='. -
endTimeStamp
public long endTimeStamp()Returns the value of theendTimeStamp
record component.- Returns:
- the value of the
endTimeStamp
record component
-