com.spotify.google.cloud.pubsub.client.PullRequestBuilder Maven / Gradle / Ivy
package com.spotify.google.cloud.pubsub.client;
import io.norberg.automatter.AutoMatter;
import javax.annotation.Generated;
@Generated("io.norberg.automatter.processor.AutoMatterProcessor")
final class PullRequestBuilder {
private boolean returnImmediately;
private int maxMessages;
public PullRequestBuilder() {
}
private PullRequestBuilder(PullRequest v) {
this.returnImmediately = v.returnImmediately();
this.maxMessages = v.maxMessages();
}
private PullRequestBuilder(PullRequestBuilder v) {
this.returnImmediately = v.returnImmediately;
this.maxMessages = v.maxMessages;
}
public boolean returnImmediately() {
return returnImmediately;
}
public PullRequestBuilder returnImmediately(boolean returnImmediately) {
this.returnImmediately = returnImmediately;
return this;
}
public int maxMessages() {
return maxMessages;
}
public PullRequestBuilder maxMessages(int maxMessages) {
this.maxMessages = maxMessages;
return this;
}
public PullRequest build() {
return new Value(returnImmediately, maxMessages);
}
public static PullRequestBuilder from(PullRequest v) {
return new PullRequestBuilder(v);
}
public static PullRequestBuilder from(PullRequestBuilder v) {
return new PullRequestBuilder(v);
}
private static final class Value implements PullRequest {
private final boolean returnImmediately;
private final int maxMessages;
private Value(@AutoMatter.Field("returnImmediately") boolean returnImmediately, @AutoMatter.Field("maxMessages") int maxMessages) {
this.returnImmediately = returnImmediately;
this.maxMessages = maxMessages;
}
@AutoMatter.Field
@Override
public boolean returnImmediately() {
return returnImmediately;
}
@AutoMatter.Field
@Override
public int maxMessages() {
return maxMessages;
}
public PullRequestBuilder builder() {
return new PullRequestBuilder(this);
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof PullRequest)) {
return false;
}
final PullRequest that = (PullRequest) o;
if (returnImmediately != that.returnImmediately()) {
return false;
}
if (maxMessages != that.maxMessages()) {
return false;
}
return true;
}
@Override
public int hashCode() {
int result = 1;
long temp;
result = 31 * result + (returnImmediately ? 1231 : 1237);
result = 31 * result + maxMessages;
return result;
}
@Override
public String toString() {
return "PullRequest{" +
"returnImmediately=" + returnImmediately +
", maxMessages=" + maxMessages +
'}';
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy