com.spotify.google.cloud.pubsub.client.ModifyAckDeadlineRequestBuilder Maven / Gradle / Ivy
package com.spotify.google.cloud.pubsub.client;
import io.norberg.automatter.AutoMatter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import javax.annotation.Generated;
@Generated("io.norberg.automatter.processor.AutoMatterProcessor")
final class ModifyAckDeadlineRequestBuilder {
private List ackIds;
private int ackDeadlineSeconds;
public ModifyAckDeadlineRequestBuilder() {
}
private ModifyAckDeadlineRequestBuilder(ModifyAckDeadlineRequest v) {
List extends String> _ackIds = v.ackIds();
this.ackIds = (_ackIds == null) ? null : new ArrayList(_ackIds);
this.ackDeadlineSeconds = v.ackDeadlineSeconds();
}
private ModifyAckDeadlineRequestBuilder(ModifyAckDeadlineRequestBuilder v) {
this.ackIds = (v.ackIds == null) ? null : new ArrayList(v.ackIds);
this.ackDeadlineSeconds = v.ackDeadlineSeconds;
}
public List ackIds() {
if (this.ackIds == null) {
this.ackIds = new ArrayList();
}
return ackIds;
}
public ModifyAckDeadlineRequestBuilder ackIds(List extends String> ackIds) {
return ackIds((Collection extends String>) ackIds);
}
public ModifyAckDeadlineRequestBuilder ackIds(Collection extends String> ackIds) {
if (ackIds == null) {
throw new NullPointerException("ackIds");
}
for (String item : ackIds) {
if (item == null) {
throw new NullPointerException("ackIds: null item");
}
}
this.ackIds = new ArrayList(ackIds);
return this;
}
public ModifyAckDeadlineRequestBuilder ackIds(Iterable extends String> ackIds) {
if (ackIds == null) {
throw new NullPointerException("ackIds");
}
if (ackIds instanceof Collection) {
return ackIds((Collection extends String>) ackIds);
}
return ackIds(ackIds.iterator());
}
public ModifyAckDeadlineRequestBuilder ackIds(Iterator extends String> ackIds) {
if (ackIds == null) {
throw new NullPointerException("ackIds");
}
this.ackIds = new ArrayList();
while (ackIds.hasNext()) {
String item = ackIds.next();
if (item == null) {
throw new NullPointerException("ackIds: null item");
}
this.ackIds.add(item);
}
return this;
}
public ModifyAckDeadlineRequestBuilder ackIds(String... ackIds) {
if (ackIds == null) {
throw new NullPointerException("ackIds");
}
return ackIds(Arrays.asList(ackIds));
}
public ModifyAckDeadlineRequestBuilder addAckId(String ackId) {
if (ackId == null) {
throw new NullPointerException("ackId");
}
if (this.ackIds == null) {
this.ackIds = new ArrayList();
}
ackIds.add(ackId);
return this;
}
public int ackDeadlineSeconds() {
return ackDeadlineSeconds;
}
public ModifyAckDeadlineRequestBuilder ackDeadlineSeconds(int ackDeadlineSeconds) {
this.ackDeadlineSeconds = ackDeadlineSeconds;
return this;
}
public ModifyAckDeadlineRequest build() {
List _ackIds = (ackIds != null) ? Collections.unmodifiableList(new ArrayList(ackIds)) : Collections.emptyList();
return new Value(_ackIds, ackDeadlineSeconds);
}
public static ModifyAckDeadlineRequestBuilder from(ModifyAckDeadlineRequest v) {
return new ModifyAckDeadlineRequestBuilder(v);
}
public static ModifyAckDeadlineRequestBuilder from(ModifyAckDeadlineRequestBuilder v) {
return new ModifyAckDeadlineRequestBuilder(v);
}
private static final class Value implements ModifyAckDeadlineRequest {
private final List ackIds;
private final int ackDeadlineSeconds;
private Value(@AutoMatter.Field("ackIds") List ackIds, @AutoMatter.Field("ackDeadlineSeconds") int ackDeadlineSeconds) {
this.ackIds = (ackIds != null) ? ackIds : Collections.emptyList();
this.ackDeadlineSeconds = ackDeadlineSeconds;
}
@AutoMatter.Field
@Override
public List ackIds() {
return ackIds;
}
@AutoMatter.Field
@Override
public int ackDeadlineSeconds() {
return ackDeadlineSeconds;
}
public ModifyAckDeadlineRequestBuilder builder() {
return new ModifyAckDeadlineRequestBuilder(this);
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof ModifyAckDeadlineRequest)) {
return false;
}
final ModifyAckDeadlineRequest that = (ModifyAckDeadlineRequest) o;
if (ackIds != null ? !ackIds.equals(that.ackIds()) : that.ackIds() != null) {
return false;
}
if (ackDeadlineSeconds != that.ackDeadlineSeconds()) {
return false;
}
return true;
}
@Override
public int hashCode() {
int result = 1;
long temp;
result = 31 * result + (ackIds != null ? ackIds.hashCode() : 0);
result = 31 * result + ackDeadlineSeconds;
return result;
}
@Override
public String toString() {
return "ModifyAckDeadlineRequest{" +
"ackIds=" + ackIds +
", ackDeadlineSeconds=" + ackDeadlineSeconds +
'}';
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy