com.github.messenger4j.webhook.event.AccountLinkingEvent 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 Max Grabenhorst
* @since 1.0.0
*/
public final class AccountLinkingEvent extends BaseEvent {
private final Status status;
private final Optional authorizationCode;
public AccountLinkingEvent(
@NonNull String senderId,
@NonNull String recipientId,
@NonNull Instant timestamp,
@NonNull Status status,
@NonNull Optional authorizationCode) {
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 (status == null) {
throw new java.lang.IllegalArgumentException("status is marked @NonNull but is null");
}
if (authorizationCode == null) {
throw new java.lang.IllegalArgumentException(
"authorizationCode is marked @NonNull but is null");
}
this.status = status;
this.authorizationCode = authorizationCode;
}
public Status status() {
return status;
}
public Optional authorizationCode() {
return authorizationCode;
}
/** @since 1.0.0 */
public enum Status {
LINKED,
UNLINKED;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public java.lang.String toString() {
return "AccountLinkingEvent(super="
+ super.toString()
+ ", status="
+ this.status
+ ", authorizationCode="
+ this.authorizationCode
+ ")";
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public boolean equals(final java.lang.Object o) {
if (o == this) return true;
if (!(o instanceof AccountLinkingEvent)) return false;
final AccountLinkingEvent other = (AccountLinkingEvent) o;
if (!other.canEqual((java.lang.Object) this)) return false;
if (!super.equals(o)) return false;
final java.lang.Object this$status = this.status;
final java.lang.Object other$status = other.status;
if (this$status == null ? other$status != null : !this$status.equals(other$status))
return false;
final java.lang.Object this$authorizationCode = this.authorizationCode;
final java.lang.Object other$authorizationCode = other.authorizationCode;
if (this$authorizationCode == null
? other$authorizationCode != null
: !this$authorizationCode.equals(other$authorizationCode)) return false;
return true;
}
@java.lang.SuppressWarnings("all")
protected boolean canEqual(final java.lang.Object other) {
return other instanceof AccountLinkingEvent;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public int hashCode() {
final int PRIME = 59;
int result = super.hashCode();
final java.lang.Object $status = this.status;
result = result * PRIME + ($status == null ? 43 : $status.hashCode());
final java.lang.Object $authorizationCode = this.authorizationCode;
result = result * PRIME + ($authorizationCode == null ? 43 : $authorizationCode.hashCode());
return result;
}
}