com.github.messenger4j.webhook.event.nlp.NLPEntity Maven / Gradle / Ivy
// Generated by delombok at Tue May 07 22:31:27 CEST 2019
package com.github.messenger4j.webhook.event.nlp;
import com.google.gson.Gson;
import lombok.NonNull;
/**
* @author Joe Tindale
* @since 1.0.0
*/
public final class NLPEntity {
private static final Gson gson = new Gson();
private final String json;
public NLPEntity(@NonNull String json) {
if (json == null) {
throw new java.lang.IllegalArgumentException("json is marked @NonNull but is null");
}
this.json = json;
}
public String asString() {
return json;
}
public T as(Class classOfT) {
return gson.fromJson(json, classOfT);
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public java.lang.String toString() {
return "NLPEntity(json=" + this.json + ")";
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public boolean equals(final java.lang.Object o) {
if (o == this) return true;
if (!(o instanceof NLPEntity)) return false;
final NLPEntity other = (NLPEntity) o;
final java.lang.Object this$json = this.json;
final java.lang.Object other$json = other.json;
if (this$json == null ? other$json != null : !this$json.equals(other$json)) 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 $json = this.json;
result = result * PRIME + ($json == null ? 43 : $json.hashCode());
return result;
}
}