it.auties.whatsapp.model.chat.ChatDisappear Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cobalt Show documentation
Show all versions of cobalt Show documentation
Standalone fully-featured Whatsapp Web API for Java and Kotlin
package it.auties.whatsapp.model.chat;
import it.auties.protobuf.annotation.ProtobufEnum;
import it.auties.protobuf.annotation.ProtobufEnumIndex;
import it.auties.protobuf.annotation.ProtobufMessage;
import it.auties.protobuf.annotation.ProtobufProperty;
import it.auties.protobuf.model.ProtobufType;
import java.util.Objects;
/**
* A model that represents a chat disappear mode
*/
@ProtobufMessage(name = "DisappearingMode")
public record ChatDisappear(
@ProtobufProperty(index = 1, type = ProtobufType.OBJECT)
Initiator initiator
) {
/**
* The constants of this enumerated type describe the various actors that can initialize
* disappearing messages in a chat
*/
@ProtobufEnum(name = "DisappearingMode.Initiator")
public enum Initiator {
/**
* Changed in chat
*/
CHANGED_IN_CHAT(0),
/**
* Initiated by me
*/
INITIATED_BY_ME(1),
/**
* Initiated by other
*/
INITIATED_BY_OTHER(2);
final int index;
Initiator(@ProtobufEnumIndex int index) {
this.index = index;
}
public int index() {
return index;
}
}
@Override
public int hashCode() {
return Objects.hashCode(initiator.index());
}
}