com.supertokens.api.resources.dashboard.requests.DeleteDashboardUserRequest Maven / Gradle / Ivy
The newest version!
package com.supertokens.api.resources.dashboard.requests;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import java.util.Objects;
import java.util.Optional;
@JsonDeserialize(builder = DeleteDashboardUserRequest.Builder.class)
public final class DeleteDashboardUserRequest {
private final Optional rid;
private final Optional email;
private final Optional userId;
private int _cachedHashCode;
DeleteDashboardUserRequest(Optional rid, Optional email, Optional userId) {
this.rid = rid;
this.email = email;
this.userId = userId;
}
@JsonProperty("rid")
public Optional getRid() {
return rid;
}
@JsonProperty("email")
public Optional getEmail() {
return email;
}
@JsonProperty("userId")
public Optional getUserId() {
return userId;
}
@Override
public boolean equals(Object other) {
if (this == other) return true;
return other instanceof DeleteDashboardUserRequest && equalTo((DeleteDashboardUserRequest) other);
}
private boolean equalTo(DeleteDashboardUserRequest other) {
return rid.equals(other.rid) && email.equals(other.email) && userId.equals(other.userId);
}
@Override
public int hashCode() {
if (_cachedHashCode == 0) {
_cachedHashCode = Objects.hash(this.rid, this.email, this.userId);
}
return _cachedHashCode;
}
@Override
public String toString() {
return "DeleteDashboardUserRequest{" + "rid: " + rid + ", email: " + email + ", userId: " + userId + "}";
}
public static Builder builder() {
return new Builder();
}
@JsonIgnoreProperties(ignoreUnknown = true)
public static final class Builder {
private Optional rid = Optional.empty();
private Optional email = Optional.empty();
private Optional userId = Optional.empty();
private Builder() {}
public Builder from(DeleteDashboardUserRequest other) {
rid(other.getRid());
email(other.getEmail());
userId(other.getUserId());
return this;
}
@JsonSetter(value = "rid", nulls = Nulls.SKIP)
public Builder rid(Optional rid) {
this.rid = rid;
return this;
}
public Builder rid(String rid) {
this.rid = Optional.of(rid);
return this;
}
@JsonSetter(value = "email", nulls = Nulls.SKIP)
public Builder email(Optional email) {
this.email = email;
return this;
}
public Builder email(String email) {
this.email = Optional.of(email);
return this;
}
@JsonSetter(value = "userId", nulls = Nulls.SKIP)
public Builder userId(Optional userId) {
this.userId = userId;
return this;
}
public Builder userId(String userId) {
this.userId = Optional.of(userId);
return this;
}
public DeleteDashboardUserRequest build() {
return new DeleteDashboardUserRequest(rid, email, userId);
}
}
}