com.spotify.github.v3.workflows.ImmutableWorkflowsResponse Maven / Gradle / Ivy
package com.spotify.github.v3.workflows;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import com.google.errorprone.annotations.Var;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import javax.annotation.CheckReturnValue;
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
import javax.annotation.concurrent.Immutable;
import javax.annotation.concurrent.NotThreadSafe;
import org.immutables.value.Generated;
/**
* Immutable implementation of {@link WorkflowsResponse}.
*
* Use the builder to create immutable instances:
* {@code ImmutableWorkflowsResponse.builder()}.
*/
@Generated(from = "WorkflowsResponse", generator = "Immutables")
@SuppressWarnings({"all"})
@ParametersAreNonnullByDefault
@javax.annotation.processing.Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableWorkflowsResponse implements WorkflowsResponse {
private final int id;
private final String nodeId;
private final String name;
private final String path;
private final WorkflowsState state;
private final ZonedDateTime createdAt;
private final ZonedDateTime updatedAt;
private final @Nullable ZonedDateTime deletedAt;
private final String url;
private final String htmlUrl;
private final String badgeUrl;
private ImmutableWorkflowsResponse(
int id,
String nodeId,
String name,
String path,
WorkflowsState state,
ZonedDateTime createdAt,
ZonedDateTime updatedAt,
@Nullable ZonedDateTime deletedAt,
String url,
String htmlUrl,
String badgeUrl) {
this.id = id;
this.nodeId = nodeId;
this.name = name;
this.path = path;
this.state = state;
this.createdAt = createdAt;
this.updatedAt = updatedAt;
this.deletedAt = deletedAt;
this.url = url;
this.htmlUrl = htmlUrl;
this.badgeUrl = badgeUrl;
}
/**
* The Workflow ID.
* @return the int
*/
@JsonProperty
@Override
public int id() {
return id;
}
/**
*Node ID
*/
@JsonProperty
@Override
public String nodeId() {
return nodeId;
}
/**
*Name.
*/
@JsonProperty
@Override
public String name() {
return name;
}
/**
*The workflow path.
*/
@JsonProperty
@Override
public String path() {
return path;
}
/**
*Indicates the state of the workflow.
*/
@JsonProperty
@Override
public WorkflowsState state() {
return state;
}
/**
* Created At
* @return The time when the workflow was created
*/
@JsonProperty
@Override
public ZonedDateTime createdAt() {
return createdAt;
}
/**
* Updated At
* @return The time when the workflow was updated
*/
@JsonProperty
@Override
public ZonedDateTime updatedAt() {
return updatedAt;
}
/**
* Deleted At
* @return The time when the workflow was deleted
*/
@JsonProperty
@Override
public @Nullable ZonedDateTime deletedAt() {
return deletedAt;
}
/**
* Url string.
* @return the string
*/
@JsonProperty
@Override
public String url() {
return url;
}
/**
* Html url string.
* @return the string
*/
@JsonProperty
@Override
public String htmlUrl() {
return htmlUrl;
}
/**
* Badge Url string.
* @return the string
*/
@JsonProperty
@Override
public String badgeUrl() {
return badgeUrl;
}
/**
* Copy the current immutable object by setting a value for the {@link WorkflowsResponse#id() id} attribute.
* A value equality check is used to prevent copying of the same value by returning {@code this}.
* @param value A new value for id
* @return A modified copy of the {@code this} object
*/
public final ImmutableWorkflowsResponse withId(int value) {
if (this.id == value) return this;
return new ImmutableWorkflowsResponse(
value,
this.nodeId,
this.name,
this.path,
this.state,
this.createdAt,
this.updatedAt,
this.deletedAt,
this.url,
this.htmlUrl,
this.badgeUrl);
}
/**
* Copy the current immutable object by setting a value for the {@link WorkflowsResponse#nodeId() nodeId} attribute.
* An equals check used to prevent copying of the same value by returning {@code this}.
* @param value A new value for nodeId
* @return A modified copy of the {@code this} object
*/
public final ImmutableWorkflowsResponse withNodeId(String value) {
String newValue = Objects.requireNonNull(value, "nodeId");
if (this.nodeId.equals(newValue)) return this;
return new ImmutableWorkflowsResponse(
this.id,
newValue,
this.name,
this.path,
this.state,
this.createdAt,
this.updatedAt,
this.deletedAt,
this.url,
this.htmlUrl,
this.badgeUrl);
}
/**
* Copy the current immutable object by setting a value for the {@link WorkflowsResponse#name() name} attribute.
* An equals check used to prevent copying of the same value by returning {@code this}.
* @param value A new value for name
* @return A modified copy of the {@code this} object
*/
public final ImmutableWorkflowsResponse withName(String value) {
String newValue = Objects.requireNonNull(value, "name");
if (this.name.equals(newValue)) return this;
return new ImmutableWorkflowsResponse(
this.id,
this.nodeId,
newValue,
this.path,
this.state,
this.createdAt,
this.updatedAt,
this.deletedAt,
this.url,
this.htmlUrl,
this.badgeUrl);
}
/**
* Copy the current immutable object by setting a value for the {@link WorkflowsResponse#path() path} attribute.
* An equals check used to prevent copying of the same value by returning {@code this}.
* @param value A new value for path
* @return A modified copy of the {@code this} object
*/
public final ImmutableWorkflowsResponse withPath(String value) {
String newValue = Objects.requireNonNull(value, "path");
if (this.path.equals(newValue)) return this;
return new ImmutableWorkflowsResponse(
this.id,
this.nodeId,
this.name,
newValue,
this.state,
this.createdAt,
this.updatedAt,
this.deletedAt,
this.url,
this.htmlUrl,
this.badgeUrl);
}
/**
* Copy the current immutable object by setting a value for the {@link WorkflowsResponse#state() state} attribute.
* A value equality check is used to prevent copying of the same value by returning {@code this}.
* @param value A new value for state
* @return A modified copy of the {@code this} object
*/
public final ImmutableWorkflowsResponse withState(WorkflowsState value) {
WorkflowsState newValue = Objects.requireNonNull(value, "state");
if (this.state == newValue) return this;
return new ImmutableWorkflowsResponse(
this.id,
this.nodeId,
this.name,
this.path,
newValue,
this.createdAt,
this.updatedAt,
this.deletedAt,
this.url,
this.htmlUrl,
this.badgeUrl);
}
/**
* Copy the current immutable object by setting a value for the {@link WorkflowsResponse#createdAt() createdAt} attribute.
* A shallow reference equality check is used to prevent copying of the same value by returning {@code this}.
* @param value A new value for createdAt
* @return A modified copy of the {@code this} object
*/
public final ImmutableWorkflowsResponse withCreatedAt(ZonedDateTime value) {
if (this.createdAt == value) return this;
ZonedDateTime newValue = Objects.requireNonNull(value, "createdAt");
return new ImmutableWorkflowsResponse(
this.id,
this.nodeId,
this.name,
this.path,
this.state,
newValue,
this.updatedAt,
this.deletedAt,
this.url,
this.htmlUrl,
this.badgeUrl);
}
/**
* Copy the current immutable object by setting a value for the {@link WorkflowsResponse#updatedAt() updatedAt} attribute.
* A shallow reference equality check is used to prevent copying of the same value by returning {@code this}.
* @param value A new value for updatedAt
* @return A modified copy of the {@code this} object
*/
public final ImmutableWorkflowsResponse withUpdatedAt(ZonedDateTime value) {
if (this.updatedAt == value) return this;
ZonedDateTime newValue = Objects.requireNonNull(value, "updatedAt");
return new ImmutableWorkflowsResponse(
this.id,
this.nodeId,
this.name,
this.path,
this.state,
this.createdAt,
newValue,
this.deletedAt,
this.url,
this.htmlUrl,
this.badgeUrl);
}
/**
* Copy the current immutable object by setting a value for the {@link WorkflowsResponse#deletedAt() deletedAt} attribute.
* A shallow reference equality check is used to prevent copying of the same value by returning {@code this}.
* @param value A new value for deletedAt (can be {@code null})
* @return A modified copy of the {@code this} object
*/
public final ImmutableWorkflowsResponse withDeletedAt(@Nullable ZonedDateTime value) {
if (this.deletedAt == value) return this;
return new ImmutableWorkflowsResponse(
this.id,
this.nodeId,
this.name,
this.path,
this.state,
this.createdAt,
this.updatedAt,
value,
this.url,
this.htmlUrl,
this.badgeUrl);
}
/**
* Copy the current immutable object by setting a value for the {@link WorkflowsResponse#url() url} attribute.
* An equals check used to prevent copying of the same value by returning {@code this}.
* @param value A new value for url
* @return A modified copy of the {@code this} object
*/
public final ImmutableWorkflowsResponse withUrl(String value) {
String newValue = Objects.requireNonNull(value, "url");
if (this.url.equals(newValue)) return this;
return new ImmutableWorkflowsResponse(
this.id,
this.nodeId,
this.name,
this.path,
this.state,
this.createdAt,
this.updatedAt,
this.deletedAt,
newValue,
this.htmlUrl,
this.badgeUrl);
}
/**
* Copy the current immutable object by setting a value for the {@link WorkflowsResponse#htmlUrl() htmlUrl} attribute.
* An equals check used to prevent copying of the same value by returning {@code this}.
* @param value A new value for htmlUrl
* @return A modified copy of the {@code this} object
*/
public final ImmutableWorkflowsResponse withHtmlUrl(String value) {
String newValue = Objects.requireNonNull(value, "htmlUrl");
if (this.htmlUrl.equals(newValue)) return this;
return new ImmutableWorkflowsResponse(
this.id,
this.nodeId,
this.name,
this.path,
this.state,
this.createdAt,
this.updatedAt,
this.deletedAt,
this.url,
newValue,
this.badgeUrl);
}
/**
* Copy the current immutable object by setting a value for the {@link WorkflowsResponse#badgeUrl() badgeUrl} attribute.
* An equals check used to prevent copying of the same value by returning {@code this}.
* @param value A new value for badgeUrl
* @return A modified copy of the {@code this} object
*/
public final ImmutableWorkflowsResponse withBadgeUrl(String value) {
String newValue = Objects.requireNonNull(value, "badgeUrl");
if (this.badgeUrl.equals(newValue)) return this;
return new ImmutableWorkflowsResponse(
this.id,
this.nodeId,
this.name,
this.path,
this.state,
this.createdAt,
this.updatedAt,
this.deletedAt,
this.url,
this.htmlUrl,
newValue);
}
/**
* This instance is equal to all instances of {@code ImmutableWorkflowsResponse} that have equal attribute values.
* @return {@code true} if {@code this} is equal to {@code another} instance
*/
@Override
public boolean equals(@Nullable Object another) {
if (this == another) return true;
return another instanceof ImmutableWorkflowsResponse
&& equalTo(0, (ImmutableWorkflowsResponse) another);
}
private boolean equalTo(int synthetic, ImmutableWorkflowsResponse another) {
return id == another.id
&& nodeId.equals(another.nodeId)
&& name.equals(another.name)
&& path.equals(another.path)
&& state.equals(another.state)
&& createdAt.equals(another.createdAt)
&& updatedAt.equals(another.updatedAt)
&& Objects.equals(deletedAt, another.deletedAt)
&& url.equals(another.url)
&& htmlUrl.equals(another.htmlUrl)
&& badgeUrl.equals(another.badgeUrl);
}
/**
* Computes a hash code from attributes: {@code id}, {@code nodeId}, {@code name}, {@code path}, {@code state}, {@code createdAt}, {@code updatedAt}, {@code deletedAt}, {@code url}, {@code htmlUrl}, {@code badgeUrl}.
* @return hashCode value
*/
@Override
public int hashCode() {
@Var int h = 5381;
h += (h << 5) + id;
h += (h << 5) + nodeId.hashCode();
h += (h << 5) + name.hashCode();
h += (h << 5) + path.hashCode();
h += (h << 5) + state.hashCode();
h += (h << 5) + createdAt.hashCode();
h += (h << 5) + updatedAt.hashCode();
h += (h << 5) + Objects.hashCode(deletedAt);
h += (h << 5) + url.hashCode();
h += (h << 5) + htmlUrl.hashCode();
h += (h << 5) + badgeUrl.hashCode();
return h;
}
/**
* Prints the immutable value {@code WorkflowsResponse} with attribute values.
* @return A string representation of the value
*/
@Override
public String toString() {
return "WorkflowsResponse{"
+ "id=" + id
+ ", nodeId=" + nodeId
+ ", name=" + name
+ ", path=" + path
+ ", state=" + state
+ ", createdAt=" + createdAt
+ ", updatedAt=" + updatedAt
+ ", deletedAt=" + deletedAt
+ ", url=" + url
+ ", htmlUrl=" + htmlUrl
+ ", badgeUrl=" + badgeUrl
+ "}";
}
/**
* Utility type used to correctly read immutable object from JSON representation.
* @deprecated Do not use this type directly, it exists only for the Jackson-binding infrastructure
*/
@Generated(from = "WorkflowsResponse", generator = "Immutables")
@Deprecated
@SuppressWarnings("Immutable")
@JsonDeserialize
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.NONE)
static final class Json implements WorkflowsResponse {
int id;
boolean idIsSet;
@Nullable String nodeId;
@Nullable String name;
@Nullable String path;
@Nullable WorkflowsState state;
@Nullable ZonedDateTime createdAt;
@Nullable ZonedDateTime updatedAt;
@Nullable ZonedDateTime deletedAt;
@Nullable String url;
@Nullable String htmlUrl;
@Nullable String badgeUrl;
@JsonProperty
public void setId(int id) {
this.id = id;
this.idIsSet = true;
}
@JsonProperty
public void setNodeId(String nodeId) {
this.nodeId = nodeId;
}
@JsonProperty
public void setName(String name) {
this.name = name;
}
@JsonProperty
public void setPath(String path) {
this.path = path;
}
@JsonProperty
public void setState(WorkflowsState state) {
this.state = state;
}
@JsonProperty
public void setCreatedAt(ZonedDateTime createdAt) {
this.createdAt = createdAt;
}
@JsonProperty
public void setUpdatedAt(ZonedDateTime updatedAt) {
this.updatedAt = updatedAt;
}
@JsonProperty
public void setDeletedAt(@Nullable ZonedDateTime deletedAt) {
this.deletedAt = deletedAt;
}
@JsonProperty
public void setUrl(String url) {
this.url = url;
}
@JsonProperty
public void setHtmlUrl(String htmlUrl) {
this.htmlUrl = htmlUrl;
}
@JsonProperty
public void setBadgeUrl(String badgeUrl) {
this.badgeUrl = badgeUrl;
}
@Override
public int id() { throw new UnsupportedOperationException(); }
@Override
public String nodeId() { throw new UnsupportedOperationException(); }
@Override
public String name() { throw new UnsupportedOperationException(); }
@Override
public String path() { throw new UnsupportedOperationException(); }
@Override
public WorkflowsState state() { throw new UnsupportedOperationException(); }
@Override
public ZonedDateTime createdAt() { throw new UnsupportedOperationException(); }
@Override
public ZonedDateTime updatedAt() { throw new UnsupportedOperationException(); }
@Override
public ZonedDateTime deletedAt() { throw new UnsupportedOperationException(); }
@Override
public String url() { throw new UnsupportedOperationException(); }
@Override
public String htmlUrl() { throw new UnsupportedOperationException(); }
@Override
public String badgeUrl() { throw new UnsupportedOperationException(); }
}
/**
* @param json A JSON-bindable data structure
* @return An immutable value type
* @deprecated Do not use this method directly, it exists only for the Jackson-binding infrastructure
*/
@Deprecated
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
static ImmutableWorkflowsResponse fromJson(Json json) {
ImmutableWorkflowsResponse.Builder builder = ImmutableWorkflowsResponse.builder();
if (json.idIsSet) {
builder.id(json.id);
}
if (json.nodeId != null) {
builder.nodeId(json.nodeId);
}
if (json.name != null) {
builder.name(json.name);
}
if (json.path != null) {
builder.path(json.path);
}
if (json.state != null) {
builder.state(json.state);
}
if (json.createdAt != null) {
builder.createdAt(json.createdAt);
}
if (json.updatedAt != null) {
builder.updatedAt(json.updatedAt);
}
if (json.deletedAt != null) {
builder.deletedAt(json.deletedAt);
}
if (json.url != null) {
builder.url(json.url);
}
if (json.htmlUrl != null) {
builder.htmlUrl(json.htmlUrl);
}
if (json.badgeUrl != null) {
builder.badgeUrl(json.badgeUrl);
}
return builder.build();
}
/**
* Creates an immutable copy of a {@link WorkflowsResponse} value.
* Uses accessors to get values to initialize the new immutable instance.
* If an instance is already immutable, it is returned as is.
* @param instance The instance to copy
* @return A copied immutable WorkflowsResponse instance
*/
public static ImmutableWorkflowsResponse copyOf(WorkflowsResponse instance) {
if (instance instanceof ImmutableWorkflowsResponse) {
return (ImmutableWorkflowsResponse) instance;
}
return ImmutableWorkflowsResponse.builder()
.from(instance)
.build();
}
/**
* Creates a builder for {@link ImmutableWorkflowsResponse ImmutableWorkflowsResponse}.
*
* ImmutableWorkflowsResponse.builder()
* .id(int) // required {@link WorkflowsResponse#id() id}
* .nodeId(String) // required {@link WorkflowsResponse#nodeId() nodeId}
* .name(String) // required {@link WorkflowsResponse#name() name}
* .path(String) // required {@link WorkflowsResponse#path() path}
* .state(com.spotify.github.v3.workflows.WorkflowsState) // required {@link WorkflowsResponse#state() state}
* .createdAt(java.time.ZonedDateTime) // required {@link WorkflowsResponse#createdAt() createdAt}
* .updatedAt(java.time.ZonedDateTime) // required {@link WorkflowsResponse#updatedAt() updatedAt}
* .deletedAt(java.time.ZonedDateTime | null) // nullable {@link WorkflowsResponse#deletedAt() deletedAt}
* .url(String) // required {@link WorkflowsResponse#url() url}
* .htmlUrl(String) // required {@link WorkflowsResponse#htmlUrl() htmlUrl}
* .badgeUrl(String) // required {@link WorkflowsResponse#badgeUrl() badgeUrl}
* .build();
*
* @return A new ImmutableWorkflowsResponse builder
*/
public static ImmutableWorkflowsResponse.Builder builder() {
return new ImmutableWorkflowsResponse.Builder();
}
/**
* Builds instances of type {@link ImmutableWorkflowsResponse ImmutableWorkflowsResponse}.
* Initialize attributes and then invoke the {@link #build()} method to create an
* immutable instance.
* {@code Builder} is not thread-safe and generally should not be stored in a field or collection,
* but instead used immediately to create instances.
*/
@Generated(from = "WorkflowsResponse", generator = "Immutables")
@NotThreadSafe
public static final class Builder {
private static final long INIT_BIT_ID = 0x1L;
private static final long INIT_BIT_NODE_ID = 0x2L;
private static final long INIT_BIT_NAME = 0x4L;
private static final long INIT_BIT_PATH = 0x8L;
private static final long INIT_BIT_STATE = 0x10L;
private static final long INIT_BIT_CREATED_AT = 0x20L;
private static final long INIT_BIT_UPDATED_AT = 0x40L;
private static final long INIT_BIT_URL = 0x80L;
private static final long INIT_BIT_HTML_URL = 0x100L;
private static final long INIT_BIT_BADGE_URL = 0x200L;
private long initBits = 0x3ffL;
private int id;
private @Nullable String nodeId;
private @Nullable String name;
private @Nullable String path;
private @Nullable WorkflowsState state;
private @Nullable ZonedDateTime createdAt;
private @Nullable ZonedDateTime updatedAt;
private @Nullable ZonedDateTime deletedAt;
private @Nullable String url;
private @Nullable String htmlUrl;
private @Nullable String badgeUrl;
private Builder() {
}
/**
* Fill a builder with attribute values from the provided {@code WorkflowsResponse} instance.
* Regular attribute values will be replaced with those from the given instance.
* Absent optional values will not replace present values.
* @param instance The instance from which to copy values
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
public final Builder from(WorkflowsResponse instance) {
Objects.requireNonNull(instance, "instance");
id(instance.id());
nodeId(instance.nodeId());
name(instance.name());
path(instance.path());
state(instance.state());
createdAt(instance.createdAt());
updatedAt(instance.updatedAt());
@Nullable ZonedDateTime deletedAtValue = instance.deletedAt();
if (deletedAtValue != null) {
deletedAt(deletedAtValue);
}
url(instance.url());
htmlUrl(instance.htmlUrl());
badgeUrl(instance.badgeUrl());
return this;
}
/**
* Initializes the value for the {@link WorkflowsResponse#id() id} attribute.
* @param id The value for id
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
@JsonProperty
public final Builder id(int id) {
this.id = id;
initBits &= ~INIT_BIT_ID;
return this;
}
/**
* Initializes the value for the {@link WorkflowsResponse#nodeId() nodeId} attribute.
* @param nodeId The value for nodeId
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
@JsonProperty
public final Builder nodeId(String nodeId) {
this.nodeId = Objects.requireNonNull(nodeId, "nodeId");
initBits &= ~INIT_BIT_NODE_ID;
return this;
}
/**
* Initializes the value for the {@link WorkflowsResponse#name() name} attribute.
* @param name The value for name
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
@JsonProperty
public final Builder name(String name) {
this.name = Objects.requireNonNull(name, "name");
initBits &= ~INIT_BIT_NAME;
return this;
}
/**
* Initializes the value for the {@link WorkflowsResponse#path() path} attribute.
* @param path The value for path
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
@JsonProperty
public final Builder path(String path) {
this.path = Objects.requireNonNull(path, "path");
initBits &= ~INIT_BIT_PATH;
return this;
}
/**
* Initializes the value for the {@link WorkflowsResponse#state() state} attribute.
* @param state The value for state
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
@JsonProperty
public final Builder state(WorkflowsState state) {
this.state = Objects.requireNonNull(state, "state");
initBits &= ~INIT_BIT_STATE;
return this;
}
/**
* Initializes the value for the {@link WorkflowsResponse#createdAt() createdAt} attribute.
* @param createdAt The value for createdAt
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
@JsonProperty
public final Builder createdAt(ZonedDateTime createdAt) {
this.createdAt = Objects.requireNonNull(createdAt, "createdAt");
initBits &= ~INIT_BIT_CREATED_AT;
return this;
}
/**
* Initializes the value for the {@link WorkflowsResponse#updatedAt() updatedAt} attribute.
* @param updatedAt The value for updatedAt
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
@JsonProperty
public final Builder updatedAt(ZonedDateTime updatedAt) {
this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt");
initBits &= ~INIT_BIT_UPDATED_AT;
return this;
}
/**
* Initializes the value for the {@link WorkflowsResponse#deletedAt() deletedAt} attribute.
* @param deletedAt The value for deletedAt (can be {@code null})
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
@JsonProperty
public final Builder deletedAt(@Nullable ZonedDateTime deletedAt) {
this.deletedAt = deletedAt;
return this;
}
/**
* Initializes the value for the {@link WorkflowsResponse#url() url} attribute.
* @param url The value for url
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
@JsonProperty
public final Builder url(String url) {
this.url = Objects.requireNonNull(url, "url");
initBits &= ~INIT_BIT_URL;
return this;
}
/**
* Initializes the value for the {@link WorkflowsResponse#htmlUrl() htmlUrl} attribute.
* @param htmlUrl The value for htmlUrl
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
@JsonProperty
public final Builder htmlUrl(String htmlUrl) {
this.htmlUrl = Objects.requireNonNull(htmlUrl, "htmlUrl");
initBits &= ~INIT_BIT_HTML_URL;
return this;
}
/**
* Initializes the value for the {@link WorkflowsResponse#badgeUrl() badgeUrl} attribute.
* @param badgeUrl The value for badgeUrl
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
@JsonProperty
public final Builder badgeUrl(String badgeUrl) {
this.badgeUrl = Objects.requireNonNull(badgeUrl, "badgeUrl");
initBits &= ~INIT_BIT_BADGE_URL;
return this;
}
/**
* Builds a new {@link ImmutableWorkflowsResponse ImmutableWorkflowsResponse}.
* @return An immutable instance of WorkflowsResponse
* @throws java.lang.IllegalStateException if any required attributes are missing
*/
public ImmutableWorkflowsResponse build() {
if (initBits != 0) {
throw new IllegalStateException(formatRequiredAttributesMessage());
}
return new ImmutableWorkflowsResponse(id, nodeId, name, path, state, createdAt, updatedAt, deletedAt, url, htmlUrl, badgeUrl);
}
private String formatRequiredAttributesMessage() {
List attributes = new ArrayList<>();
if ((initBits & INIT_BIT_ID) != 0) attributes.add("id");
if ((initBits & INIT_BIT_NODE_ID) != 0) attributes.add("nodeId");
if ((initBits & INIT_BIT_NAME) != 0) attributes.add("name");
if ((initBits & INIT_BIT_PATH) != 0) attributes.add("path");
if ((initBits & INIT_BIT_STATE) != 0) attributes.add("state");
if ((initBits & INIT_BIT_CREATED_AT) != 0) attributes.add("createdAt");
if ((initBits & INIT_BIT_UPDATED_AT) != 0) attributes.add("updatedAt");
if ((initBits & INIT_BIT_URL) != 0) attributes.add("url");
if ((initBits & INIT_BIT_HTML_URL) != 0) attributes.add("htmlUrl");
if ((initBits & INIT_BIT_BADGE_URL) != 0) attributes.add("badgeUrl");
return "Cannot build WorkflowsResponse, some of required attributes are not set " + attributes;
}
}
}