Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.github.messenger4j.send.message.template.ReceiptTemplate Maven / Gradle / Ivy
// Generated by delombok at Tue May 07 22:31:27 CEST 2019
package com.github.messenger4j.send.message.template;
import static java.util.Optional.empty;
import com.github.messenger4j.internal.Lists;
import com.github.messenger4j.internal.gson.OptionalInstantToSecondsStringSerializer;
import com.github.messenger4j.send.message.template.receipt.Address;
import com.github.messenger4j.send.message.template.receipt.Adjustment;
import com.github.messenger4j.send.message.template.receipt.Item;
import com.github.messenger4j.send.message.template.receipt.Summary;
import com.google.gson.annotations.JsonAdapter;
import java.net.URL;
import java.time.Instant;
import java.util.List;
import java.util.Optional;
import lombok.NonNull;
/**
* @author Max Grabenhorst
* @since 1.0.0
*/
public final class ReceiptTemplate extends Template {
private final String recipientName;
private final String orderNumber;
private final String paymentMethod;
private final String currency;
private final Summary summary;
private final Optional address;
private final Optional> elements;
private final Optional> adjustments;
private final Optional merchantName;
private final Optional orderUrl;
private final Optional sharable;
@JsonAdapter(OptionalInstantToSecondsStringSerializer.class)
private final Optional timestamp;
private ReceiptTemplate(
String recipientName,
String orderNumber,
String paymentMethod,
String currency,
Summary summary,
Optional address,
Optional> elements,
Optional> adjustments,
Optional merchantName,
Optional orderUrl,
Optional sharable,
Optional timestamp) {
super(Type.RECEIPT);
this.recipientName = recipientName;
this.orderNumber = orderNumber;
this.paymentMethod = paymentMethod;
this.currency = currency;
this.summary = summary;
this.address = address;
this.elements = elements.map(Lists::immutableList);
this.adjustments = adjustments.map(Lists::immutableList);
this.merchantName = merchantName;
this.orderUrl = orderUrl;
this.sharable = sharable;
this.timestamp = timestamp;
}
public static ReceiptTemplate create(
@NonNull String recipientName,
@NonNull String orderNumber,
@NonNull String paymentMethod,
@NonNull String currency,
@NonNull Summary summary) {
if (recipientName == null) {
throw new java.lang.IllegalArgumentException("recipientName is marked @NonNull but is null");
}
if (orderNumber == null) {
throw new java.lang.IllegalArgumentException("orderNumber is marked @NonNull but is null");
}
if (paymentMethod == null) {
throw new java.lang.IllegalArgumentException("paymentMethod is marked @NonNull but is null");
}
if (currency == null) {
throw new java.lang.IllegalArgumentException("currency is marked @NonNull but is null");
}
if (summary == null) {
throw new java.lang.IllegalArgumentException("summary is marked @NonNull but is null");
}
return create(
recipientName,
orderNumber,
paymentMethod,
currency,
summary,
empty(),
empty(),
empty(),
empty(),
empty(),
empty(),
empty());
}
public static ReceiptTemplate create(
@NonNull String recipientName,
@NonNull String orderNumber,
@NonNull String paymentMethod,
@NonNull String currency,
@NonNull Summary summary,
@NonNull Optional address,
@NonNull Optional> elements,
@NonNull Optional> adjustments,
@NonNull Optional merchantName,
@NonNull Optional orderUrl,
@NonNull Optional sharable,
@NonNull Optional timestamp) {
if (recipientName == null) {
throw new java.lang.IllegalArgumentException("recipientName is marked @NonNull but is null");
}
if (orderNumber == null) {
throw new java.lang.IllegalArgumentException("orderNumber is marked @NonNull but is null");
}
if (paymentMethod == null) {
throw new java.lang.IllegalArgumentException("paymentMethod is marked @NonNull but is null");
}
if (currency == null) {
throw new java.lang.IllegalArgumentException("currency is marked @NonNull but is null");
}
if (summary == null) {
throw new java.lang.IllegalArgumentException("summary is marked @NonNull but is null");
}
if (address == null) {
throw new java.lang.IllegalArgumentException("address is marked @NonNull but is null");
}
if (elements == null) {
throw new java.lang.IllegalArgumentException("elements is marked @NonNull but is null");
}
if (adjustments == null) {
throw new java.lang.IllegalArgumentException("adjustments is marked @NonNull but is null");
}
if (merchantName == null) {
throw new java.lang.IllegalArgumentException("merchantName is marked @NonNull but is null");
}
if (orderUrl == null) {
throw new java.lang.IllegalArgumentException("orderUrl is marked @NonNull but is null");
}
if (sharable == null) {
throw new java.lang.IllegalArgumentException("sharable is marked @NonNull but is null");
}
if (timestamp == null) {
throw new java.lang.IllegalArgumentException("timestamp is marked @NonNull but is null");
}
return new ReceiptTemplate(
recipientName,
orderNumber,
paymentMethod,
currency,
summary,
address,
elements,
adjustments,
merchantName,
orderUrl,
sharable,
timestamp);
}
public String recipientName() {
return recipientName;
}
public String orderNumber() {
return orderNumber;
}
public String paymentMethod() {
return paymentMethod;
}
public String currency() {
return currency;
}
public Summary summary() {
return summary;
}
public Optional address() {
return address;
}
public Optional> elements() {
return elements;
}
public Optional> adjustments() {
return adjustments;
}
public Optional merchantName() {
return merchantName;
}
public Optional orderUrl() {
return orderUrl;
}
public Optional sharable() {
return sharable;
}
public Optional timestamp() {
return timestamp;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public java.lang.String toString() {
return "ReceiptTemplate(super="
+ super.toString()
+ ", recipientName="
+ this.recipientName
+ ", orderNumber="
+ this.orderNumber
+ ", paymentMethod="
+ this.paymentMethod
+ ", currency="
+ this.currency
+ ", summary="
+ this.summary
+ ", address="
+ this.address
+ ", elements="
+ this.elements
+ ", adjustments="
+ this.adjustments
+ ", merchantName="
+ this.merchantName
+ ", orderUrl="
+ this.orderUrl
+ ", sharable="
+ this.sharable
+ ", timestamp="
+ this.timestamp
+ ")";
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public boolean equals(final java.lang.Object o) {
if (o == this) return true;
if (!(o instanceof ReceiptTemplate)) return false;
final ReceiptTemplate other = (ReceiptTemplate) o;
if (!other.canEqual((java.lang.Object) this)) return false;
if (!super.equals(o)) return false;
final java.lang.Object this$recipientName = this.recipientName;
final java.lang.Object other$recipientName = other.recipientName;
if (this$recipientName == null
? other$recipientName != null
: !this$recipientName.equals(other$recipientName)) return false;
final java.lang.Object this$orderNumber = this.orderNumber;
final java.lang.Object other$orderNumber = other.orderNumber;
if (this$orderNumber == null
? other$orderNumber != null
: !this$orderNumber.equals(other$orderNumber)) return false;
final java.lang.Object this$paymentMethod = this.paymentMethod;
final java.lang.Object other$paymentMethod = other.paymentMethod;
if (this$paymentMethod == null
? other$paymentMethod != null
: !this$paymentMethod.equals(other$paymentMethod)) return false;
final java.lang.Object this$currency = this.currency;
final java.lang.Object other$currency = other.currency;
if (this$currency == null ? other$currency != null : !this$currency.equals(other$currency))
return false;
final java.lang.Object this$summary = this.summary;
final java.lang.Object other$summary = other.summary;
if (this$summary == null ? other$summary != null : !this$summary.equals(other$summary))
return false;
final java.lang.Object this$address = this.address;
final java.lang.Object other$address = other.address;
if (this$address == null ? other$address != null : !this$address.equals(other$address))
return false;
final java.lang.Object this$elements = this.elements;
final java.lang.Object other$elements = other.elements;
if (this$elements == null ? other$elements != null : !this$elements.equals(other$elements))
return false;
final java.lang.Object this$adjustments = this.adjustments;
final java.lang.Object other$adjustments = other.adjustments;
if (this$adjustments == null
? other$adjustments != null
: !this$adjustments.equals(other$adjustments)) return false;
final java.lang.Object this$merchantName = this.merchantName;
final java.lang.Object other$merchantName = other.merchantName;
if (this$merchantName == null
? other$merchantName != null
: !this$merchantName.equals(other$merchantName)) return false;
final java.lang.Object this$orderUrl = this.orderUrl;
final java.lang.Object other$orderUrl = other.orderUrl;
if (this$orderUrl == null ? other$orderUrl != null : !this$orderUrl.equals(other$orderUrl))
return false;
final java.lang.Object this$sharable = this.sharable;
final java.lang.Object other$sharable = other.sharable;
if (this$sharable == null ? other$sharable != null : !this$sharable.equals(other$sharable))
return false;
final java.lang.Object this$timestamp = this.timestamp;
final java.lang.Object other$timestamp = other.timestamp;
if (this$timestamp == null ? other$timestamp != null : !this$timestamp.equals(other$timestamp))
return false;
return true;
}
@java.lang.SuppressWarnings("all")
protected boolean canEqual(final java.lang.Object other) {
return other instanceof ReceiptTemplate;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public int hashCode() {
final int PRIME = 59;
int result = super.hashCode();
final java.lang.Object $recipientName = this.recipientName;
result = result * PRIME + ($recipientName == null ? 43 : $recipientName.hashCode());
final java.lang.Object $orderNumber = this.orderNumber;
result = result * PRIME + ($orderNumber == null ? 43 : $orderNumber.hashCode());
final java.lang.Object $paymentMethod = this.paymentMethod;
result = result * PRIME + ($paymentMethod == null ? 43 : $paymentMethod.hashCode());
final java.lang.Object $currency = this.currency;
result = result * PRIME + ($currency == null ? 43 : $currency.hashCode());
final java.lang.Object $summary = this.summary;
result = result * PRIME + ($summary == null ? 43 : $summary.hashCode());
final java.lang.Object $address = this.address;
result = result * PRIME + ($address == null ? 43 : $address.hashCode());
final java.lang.Object $elements = this.elements;
result = result * PRIME + ($elements == null ? 43 : $elements.hashCode());
final java.lang.Object $adjustments = this.adjustments;
result = result * PRIME + ($adjustments == null ? 43 : $adjustments.hashCode());
final java.lang.Object $merchantName = this.merchantName;
result = result * PRIME + ($merchantName == null ? 43 : $merchantName.hashCode());
final java.lang.Object $orderUrl = this.orderUrl;
result = result * PRIME + ($orderUrl == null ? 43 : $orderUrl.hashCode());
final java.lang.Object $sharable = this.sharable;
result = result * PRIME + ($sharable == null ? 43 : $sharable.hashCode());
final java.lang.Object $timestamp = this.timestamp;
result = result * PRIME + ($timestamp == null ? 43 : $timestamp.hashCode());
return result;
}
}