com.github.messenger4j.webhook.event.InstantGameEvent Maven / Gradle / Ivy
// Generated by delombok at Tue May 07 22:31:27 CEST 2019
package com.github.messenger4j.webhook.event;
import java.time.Instant;
import java.util.Optional;
import lombok.NonNull;
/**
* @author Marco Song
* @since 1.0.0
*/
public final class InstantGameEvent extends BaseEvent {
private final String gameId;
private final String playerId;
private final String contextType;
private final Optional contextId;
private final Optional score;
private final Optional payload;
public InstantGameEvent(
@NonNull String senderId,
@NonNull String recipientId,
@NonNull Instant timestamp,
@NonNull String gameId,
@NonNull String playerId,
@NonNull String contextType,
@NonNull Optional contextId,
@NonNull Optional score,
@NonNull Optional payload) {
super(senderId, recipientId, timestamp);
if (senderId == null) {
throw new java.lang.IllegalArgumentException("senderId is marked @NonNull but is null");
}
if (recipientId == null) {
throw new java.lang.IllegalArgumentException("recipientId is marked @NonNull but is null");
}
if (timestamp == null) {
throw new java.lang.IllegalArgumentException("timestamp is marked @NonNull but is null");
}
if (gameId == null) {
throw new java.lang.IllegalArgumentException("gameId is marked @NonNull but is null");
}
if (playerId == null) {
throw new java.lang.IllegalArgumentException("playerId is marked @NonNull but is null");
}
if (contextType == null) {
throw new java.lang.IllegalArgumentException("contextType is marked @NonNull but is null");
}
if (contextId == null) {
throw new java.lang.IllegalArgumentException("contextId is marked @NonNull but is null");
}
if (score == null) {
throw new java.lang.IllegalArgumentException("score is marked @NonNull but is null");
}
if (payload == null) {
throw new java.lang.IllegalArgumentException("payload is marked @NonNull but is null");
}
this.gameId = gameId;
this.playerId = playerId;
this.contextType = contextType;
this.contextId = contextId;
this.score = score;
this.payload = payload;
}
public String gameId() {
return gameId;
}
public String playerId() {
return playerId;
}
public String contextType() {
return contextType;
}
public Optional contextId() {
return contextId;
}
public Optional score() {
return score;
}
public Optional payload() {
return payload;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public java.lang.String toString() {
return "InstantGameEvent(super="
+ super.toString()
+ ", gameId="
+ this.gameId
+ ", playerId="
+ this.playerId
+ ", contextType="
+ this.contextType
+ ", contextId="
+ this.contextId
+ ", score="
+ this.score
+ ", payload="
+ this.payload
+ ")";
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public boolean equals(final java.lang.Object o) {
if (o == this) return true;
if (!(o instanceof InstantGameEvent)) return false;
final InstantGameEvent other = (InstantGameEvent) o;
if (!other.canEqual((java.lang.Object) this)) return false;
if (!super.equals(o)) return false;
final java.lang.Object this$gameId = this.gameId;
final java.lang.Object other$gameId = other.gameId;
if (this$gameId == null ? other$gameId != null : !this$gameId.equals(other$gameId))
return false;
final java.lang.Object this$playerId = this.playerId;
final java.lang.Object other$playerId = other.playerId;
if (this$playerId == null ? other$playerId != null : !this$playerId.equals(other$playerId))
return false;
final java.lang.Object this$contextType = this.contextType;
final java.lang.Object other$contextType = other.contextType;
if (this$contextType == null
? other$contextType != null
: !this$contextType.equals(other$contextType)) return false;
final java.lang.Object this$contextId = this.contextId;
final java.lang.Object other$contextId = other.contextId;
if (this$contextId == null ? other$contextId != null : !this$contextId.equals(other$contextId))
return false;
final java.lang.Object this$score = this.score;
final java.lang.Object other$score = other.score;
if (this$score == null ? other$score != null : !this$score.equals(other$score)) return false;
final java.lang.Object this$payload = this.payload;
final java.lang.Object other$payload = other.payload;
if (this$payload == null ? other$payload != null : !this$payload.equals(other$payload))
return false;
return true;
}
@java.lang.SuppressWarnings("all")
protected boolean canEqual(final java.lang.Object other) {
return other instanceof InstantGameEvent;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public int hashCode() {
final int PRIME = 59;
int result = super.hashCode();
final java.lang.Object $gameId = this.gameId;
result = result * PRIME + ($gameId == null ? 43 : $gameId.hashCode());
final java.lang.Object $playerId = this.playerId;
result = result * PRIME + ($playerId == null ? 43 : $playerId.hashCode());
final java.lang.Object $contextType = this.contextType;
result = result * PRIME + ($contextType == null ? 43 : $contextType.hashCode());
final java.lang.Object $contextId = this.contextId;
result = result * PRIME + ($contextId == null ? 43 : $contextId.hashCode());
final java.lang.Object $score = this.score;
result = result * PRIME + ($score == null ? 43 : $score.hashCode());
final java.lang.Object $payload = this.payload;
result = result * PRIME + ($payload == null ? 43 : $payload.hashCode());
return result;
}
}