All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.messenger4j.send.message.template.button.CallButton Maven / Gradle / Ivy

// Generated by delombok at Tue May 07 22:31:27 CEST 2019
package com.github.messenger4j.send.message.template.button;

import lombok.NonNull;

/**
 * @author Max Grabenhorst
 * @since 1.0.0
 */
public final class CallButton extends Button {
  private final String title;
  private final String payload;

  private CallButton(String title, String payload) {
    super(Type.PHONE_NUMBER);
    this.title = title;
    this.payload = payload;
  }

  public static CallButton create(@NonNull String title, @NonNull String payload) {
    if (title == null) {
      throw new java.lang.IllegalArgumentException("title is marked @NonNull but is null");
    }
    if (payload == null) {
      throw new java.lang.IllegalArgumentException("payload is marked @NonNull but is null");
    }
    return new CallButton(title, payload);
  }

  public String title() {
    return title;
  }

  public String payload() {
    return payload;
  }

  @java.lang.Override
  @java.lang.SuppressWarnings("all")
  public java.lang.String toString() {
    return "CallButton(super="
        + super.toString()
        + ", title="
        + this.title
        + ", 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 CallButton)) return false;
    final CallButton other = (CallButton) o;
    if (!other.canEqual((java.lang.Object) this)) return false;
    if (!super.equals(o)) return false;
    final java.lang.Object this$title = this.title;
    final java.lang.Object other$title = other.title;
    if (this$title == null ? other$title != null : !this$title.equals(other$title)) 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 CallButton;
  }

  @java.lang.Override
  @java.lang.SuppressWarnings("all")
  public int hashCode() {
    final int PRIME = 59;
    int result = super.hashCode();
    final java.lang.Object $title = this.title;
    result = result * PRIME + ($title == null ? 43 : $title.hashCode());
    final java.lang.Object $payload = this.payload;
    result = result * PRIME + ($payload == null ? 43 : $payload.hashCode());
    return result;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy