com.github.messenger4j.send.MessageResponse Maven / Gradle / Ivy
// Generated by delombok at Tue May 07 22:31:27 CEST 2019
package com.github.messenger4j.send;
import java.util.Optional;
import lombok.NonNull;
/**
* @author Max Grabenhorst
* @since 1.0.0
*/
public final class MessageResponse {
private final Optional recipientId;
private final Optional messageId;
private final Optional attachmentId;
public MessageResponse(
@NonNull Optional recipientId,
@NonNull Optional messageId,
@NonNull Optional attachmentId) {
if (recipientId == null) {
throw new java.lang.IllegalArgumentException("recipientId is marked @NonNull but is null");
}
if (messageId == null) {
throw new java.lang.IllegalArgumentException("messageId is marked @NonNull but is null");
}
if (attachmentId == null) {
throw new java.lang.IllegalArgumentException("attachmentId is marked @NonNull but is null");
}
this.recipientId = recipientId;
this.messageId = messageId;
this.attachmentId = attachmentId;
}
public Optional recipientId() {
return recipientId;
}
public Optional messageId() {
return messageId;
}
public Optional attachmentId() {
return this.attachmentId;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public java.lang.String toString() {
return "MessageResponse(recipientId="
+ this.recipientId
+ ", messageId="
+ this.messageId
+ ", attachmentId="
+ this.attachmentId
+ ")";
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public boolean equals(final java.lang.Object o) {
if (o == this) return true;
if (!(o instanceof MessageResponse)) return false;
final MessageResponse other = (MessageResponse) o;
final java.lang.Object this$recipientId = this.recipientId;
final java.lang.Object other$recipientId = other.recipientId;
if (this$recipientId == null
? other$recipientId != null
: !this$recipientId.equals(other$recipientId)) return false;
final java.lang.Object this$messageId = this.messageId;
final java.lang.Object other$messageId = other.messageId;
if (this$messageId == null ? other$messageId != null : !this$messageId.equals(other$messageId))
return false;
final java.lang.Object this$attachmentId = this.attachmentId;
final java.lang.Object other$attachmentId = other.attachmentId;
if (this$attachmentId == null
? other$attachmentId != null
: !this$attachmentId.equals(other$attachmentId)) return false;
return true;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public int hashCode() {
final int PRIME = 59;
int result = 1;
final java.lang.Object $recipientId = this.recipientId;
result = result * PRIME + ($recipientId == null ? 43 : $recipientId.hashCode());
final java.lang.Object $messageId = this.messageId;
result = result * PRIME + ($messageId == null ? 43 : $messageId.hashCode());
final java.lang.Object $attachmentId = this.attachmentId;
result = result * PRIME + ($attachmentId == null ? 43 : $attachmentId.hashCode());
return result;
}
}