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

com.stripe.model.EventData Maven / Gradle / Ivy

There is a newer version: 26.13.0-beta.1
Show newest version
// Generated by delombok at Tue Sep 03 10:42:51 PDT 2019
package com.stripe.model;

import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.annotations.SerializedName;
import java.util.Map;

public class EventData extends StripeObject {
  /**
   * Raw JSON object intended to be deserialized as {@code StripeObject}. The deserialization should
   * be deferred to the user. See the now deprecated method {@link EventData#getObject()}.
   */
  @SerializedName("object")
  JsonObject object;
  /**
   * Object containing the names of the attributes that have changed, and their previous values
   * (sent along only with *.updated events). The untyped object here is composed of {@code
   * Map}, {@code List}, and basic Java data types. The array was previously
   * represented as {@code Object[]} in `stripe-java` below v9.x
   */
  @SerializedName("previous_attributes")
  Map previousAttributes;

  /**
   * Deprecated in favor of getting {@code StripeObject} from {@link
   * Event#getDataObjectDeserializer()} and {@link EventDataObjectDeserializer#getObject()}. Throws
   * {@link JsonParseException} deserialization failure due to general invalid JSON, or more
   * specifically when JSON data and model class have incompatible schemas.
   *
   * @return deserialized stripe object for event data.
   */
  @Deprecated
  public StripeObject getObject() {
    return EventDataDeserializer.deserializeStripeObject(object);
  }

  /**
   * Object containing the names of the attributes that have changed, and their previous values
   * (sent along only with *.updated events). The untyped object here is composed of {@code
   * Map}, {@code List}, and basic Java data types. The array was previously
   * represented as {@code Object[]} in `stripe-java` below v9.x
   */
  @java.lang.SuppressWarnings("all")
  @lombok.Generated
  public Map getPreviousAttributes() {
    return this.previousAttributes;
  }

  /**
   * Raw JSON object intended to be deserialized as {@code StripeObject}. The deserialization should
   * be deferred to the user. See the now deprecated method {@link EventData#getObject()}.
   */
  @java.lang.SuppressWarnings("all")
  @lombok.Generated
  public void setObject(final JsonObject object) {
    this.object = object;
  }

  /**
   * Object containing the names of the attributes that have changed, and their previous values
   * (sent along only with *.updated events). The untyped object here is composed of {@code
   * Map}, {@code List}, and basic Java data types. The array was previously
   * represented as {@code Object[]} in `stripe-java` below v9.x
   */
  @java.lang.SuppressWarnings("all")
  @lombok.Generated
  public void setPreviousAttributes(final Map previousAttributes) {
    this.previousAttributes = previousAttributes;
  }

  @java.lang.Override
  @java.lang.SuppressWarnings("all")
  @lombok.Generated
  public boolean equals(final java.lang.Object o) {
    if (o == this) return true;
    if (!(o instanceof EventData)) return false;
    final EventData other = (EventData) o;
    if (!other.canEqual((java.lang.Object) this)) return false;
    final java.lang.Object this$object = this.getObject();
    final java.lang.Object other$object = other.getObject();
    if (this$object == null ? other$object != null : !this$object.equals(other$object)) return false;
    final java.lang.Object this$previousAttributes = this.getPreviousAttributes();
    final java.lang.Object other$previousAttributes = other.getPreviousAttributes();
    if (this$previousAttributes == null ? other$previousAttributes != null : !this$previousAttributes.equals(other$previousAttributes)) return false;
    return true;
  }

  @java.lang.SuppressWarnings("all")
  @lombok.Generated
  protected boolean canEqual(final java.lang.Object other) {
    return other instanceof EventData;
  }

  @java.lang.Override
  @java.lang.SuppressWarnings("all")
  @lombok.Generated
  public int hashCode() {
    final int PRIME = 59;
    int result = 1;
    final java.lang.Object $object = this.getObject();
    result = result * PRIME + ($object == null ? 43 : $object.hashCode());
    final java.lang.Object $previousAttributes = this.getPreviousAttributes();
    result = result * PRIME + ($previousAttributes == null ? 43 : $previousAttributes.hashCode());
    return result;
  }
}