org.cloudfoundry.uaa.clients.ListClientsRequest Maven / Gradle / Ivy
package org.cloudfoundry.uaa.clients;
import java.util.Objects;
import org.cloudfoundry.Nullable;
import org.cloudfoundry.uaa.IdentityZoned;
import org.cloudfoundry.uaa.PaginatedAndSortedByRequest;
import org.cloudfoundry.uaa.PaginatedAndSortedRequest;
import org.cloudfoundry.uaa.SortOrder;
import org.immutables.value.Generated;
/**
* The request payload for the list clients operation
*/
@Generated(from = "_ListClientsRequest", generator = "Immutables")
@SuppressWarnings({"all"})
@javax.annotation.Generated("org.immutables.processor.ProxyProcessor")
public final class ListClientsRequest extends org.cloudfoundry.uaa.clients._ListClientsRequest {
private final @Nullable String identityZoneId;
private final @Nullable String identityZoneSubdomain;
private final @Nullable Integer count;
private final @Nullable String filter;
private final @Nullable SortOrder sortOrder;
private final @Nullable Integer startIndex;
private final @Nullable String sortBy;
private ListClientsRequest(ListClientsRequest.Builder builder) {
this.identityZoneId = builder.identityZoneId;
this.identityZoneSubdomain = builder.identityZoneSubdomain;
this.count = builder.count;
this.filter = builder.filter;
this.sortOrder = builder.sortOrder;
this.startIndex = builder.startIndex;
this.sortBy = builder.sortBy;
}
/**
* Returns the identity zone id
* @return the identity zone id
*/
@Override
public @Nullable String getIdentityZoneId() {
return identityZoneId;
}
/**
* Returns the identity zone subdomain
* @return the identity zone subdomain
*/
@Override
public @Nullable String getIdentityZoneSubdomain() {
return identityZoneSubdomain;
}
/**
* The number of results per page
*/
@Override
public @Nullable Integer getCount() {
return count;
}
/**
* The filter
*/
@Override
public @Nullable String getFilter() {
return filter;
}
/**
* The sort order
*/
@Override
public @Nullable SortOrder getSortOrder() {
return sortOrder;
}
/**
* The start index
*/
@Override
public @Nullable Integer getStartIndex() {
return startIndex;
}
/**
* The sort by
*/
@Override
public @Nullable String getSortBy() {
return sortBy;
}
/**
* This instance is equal to all instances of {@code ListClientsRequest} that have equal attribute values.
* @return {@code true} if {@code this} is equal to {@code another} instance
*/
@Override
public boolean equals(Object another) {
if (this == another) return true;
return another instanceof ListClientsRequest
&& equalTo(0, (ListClientsRequest) another);
}
private boolean equalTo(int synthetic, ListClientsRequest another) {
return Objects.equals(identityZoneId, another.identityZoneId)
&& Objects.equals(identityZoneSubdomain, another.identityZoneSubdomain)
&& Objects.equals(count, another.count)
&& Objects.equals(filter, another.filter)
&& Objects.equals(sortOrder, another.sortOrder)
&& Objects.equals(startIndex, another.startIndex)
&& Objects.equals(sortBy, another.sortBy);
}
/**
* Computes a hash code from attributes: {@code identityZoneId}, {@code identityZoneSubdomain}, {@code count}, {@code filter}, {@code sortOrder}, {@code startIndex}, {@code sortBy}.
* @return hashCode value
*/
@Override
public int hashCode() {
int h = 5381;
h += (h << 5) + Objects.hashCode(identityZoneId);
h += (h << 5) + Objects.hashCode(identityZoneSubdomain);
h += (h << 5) + Objects.hashCode(count);
h += (h << 5) + Objects.hashCode(filter);
h += (h << 5) + Objects.hashCode(sortOrder);
h += (h << 5) + Objects.hashCode(startIndex);
h += (h << 5) + Objects.hashCode(sortBy);
return h;
}
/**
* Prints the immutable value {@code ListClientsRequest} with attribute values.
* @return A string representation of the value
*/
@Override
public String toString() {
return "ListClientsRequest{"
+ "identityZoneId=" + identityZoneId
+ ", identityZoneSubdomain=" + identityZoneSubdomain
+ ", count=" + count
+ ", filter=" + filter
+ ", sortOrder=" + sortOrder
+ ", startIndex=" + startIndex
+ ", sortBy=" + sortBy
+ "}";
}
/**
* Creates a builder for {@link ListClientsRequest ListClientsRequest}.
*
* ListClientsRequest.builder()
* .identityZoneId(String | null) // nullable {@link ListClientsRequest#getIdentityZoneId() identityZoneId}
* .identityZoneSubdomain(String | null) // nullable {@link ListClientsRequest#getIdentityZoneSubdomain() identityZoneSubdomain}
* .count(Integer | null) // nullable {@link ListClientsRequest#getCount() count}
* .filter(String | null) // nullable {@link ListClientsRequest#getFilter() filter}
* .sortOrder(org.cloudfoundry.uaa.SortOrder | null) // nullable {@link ListClientsRequest#getSortOrder() sortOrder}
* .startIndex(Integer | null) // nullable {@link ListClientsRequest#getStartIndex() startIndex}
* .sortBy(String | null) // nullable {@link ListClientsRequest#getSortBy() sortBy}
* .build();
*
* @return A new ListClientsRequest builder
*/
public static ListClientsRequest.Builder builder() {
return new ListClientsRequest.Builder();
}
/**
* Builds instances of type {@link ListClientsRequest ListClientsRequest}.
* 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 = "_ListClientsRequest", generator = "Immutables")
public static final class Builder {
private String identityZoneId;
private String identityZoneSubdomain;
private Integer count;
private String filter;
private SortOrder sortOrder;
private Integer startIndex;
private String sortBy;
private Builder() {
}
/**
* Fill a builder with attribute values from the provided {@code ListClientsRequest} instance.
* @param instance The instance from which to copy values
* @return {@code this} builder for use in a chained invocation
*/
public final Builder from(ListClientsRequest instance) {
Objects.requireNonNull(instance, "instance");
from((short) 0, (Object) instance);
return this;
}
/**
* Copy abstract value type {@code _ListClientsRequest} instance into builder.
* @param instance The instance from which to copy values
* @return {@code this} builder for use in a chained invocation
*/
public final Builder from(_ListClientsRequest instance) {
Objects.requireNonNull(instance, "instance");
from((short) 0, (Object) instance);
return this;
}
/**
* Fill a builder with attribute values from the provided {@code org.cloudfoundry.uaa.PaginatedAndSortedRequest} instance.
* @param instance The instance from which to copy values
* @return {@code this} builder for use in a chained invocation
*/
public final Builder from(PaginatedAndSortedRequest instance) {
Objects.requireNonNull(instance, "instance");
from((short) 0, (Object) instance);
return this;
}
/**
* Fill a builder with attribute values from the provided {@code org.cloudfoundry.uaa.PaginatedAndSortedByRequest} instance.
* @param instance The instance from which to copy values
* @return {@code this} builder for use in a chained invocation
*/
public final Builder from(PaginatedAndSortedByRequest instance) {
Objects.requireNonNull(instance, "instance");
from((short) 0, (Object) instance);
return this;
}
/**
* Fill a builder with attribute values from the provided {@code org.cloudfoundry.uaa.IdentityZoned} instance.
* @param instance The instance from which to copy values
* @return {@code this} builder for use in a chained invocation
*/
public final Builder from(IdentityZoned instance) {
Objects.requireNonNull(instance, "instance");
from((short) 0, (Object) instance);
return this;
}
private void from(short _unused, Object object) {
long bits = 0;
if (object instanceof org.cloudfoundry.uaa.clients._ListClientsRequest) {
org.cloudfoundry.uaa.clients._ListClientsRequest instance = (org.cloudfoundry.uaa.clients._ListClientsRequest) object;
if ((bits & 0x2L) == 0) {
String filterValue = instance.getFilter();
if (filterValue != null) {
filter(filterValue);
}
bits |= 0x2L;
}
if ((bits & 0x4L) == 0) {
Integer startIndexValue = instance.getStartIndex();
if (startIndexValue != null) {
startIndex(startIndexValue);
}
bits |= 0x4L;
}
if ((bits & 0x8L) == 0) {
String identityZoneSubdomainValue = instance.getIdentityZoneSubdomain();
if (identityZoneSubdomainValue != null) {
identityZoneSubdomain(identityZoneSubdomainValue);
}
bits |= 0x8L;
}
if ((bits & 0x10L) == 0) {
SortOrder sortOrderValue = instance.getSortOrder();
if (sortOrderValue != null) {
sortOrder(sortOrderValue);
}
bits |= 0x10L;
}
if ((bits & 0x1L) == 0) {
Integer countValue = instance.getCount();
if (countValue != null) {
count(countValue);
}
bits |= 0x1L;
}
if ((bits & 0x20L) == 0) {
String sortByValue = instance.getSortBy();
if (sortByValue != null) {
sortBy(sortByValue);
}
bits |= 0x20L;
}
if ((bits & 0x40L) == 0) {
String identityZoneIdValue = instance.getIdentityZoneId();
if (identityZoneIdValue != null) {
identityZoneId(identityZoneIdValue);
}
bits |= 0x40L;
}
}
if (object instanceof PaginatedAndSortedRequest) {
PaginatedAndSortedRequest instance = (PaginatedAndSortedRequest) object;
if ((bits & 0x1L) == 0) {
Integer countValue = instance.getCount();
if (countValue != null) {
count(countValue);
}
bits |= 0x1L;
}
if ((bits & 0x2L) == 0) {
String filterValue = instance.getFilter();
if (filterValue != null) {
filter(filterValue);
}
bits |= 0x2L;
}
if ((bits & 0x4L) == 0) {
Integer startIndexValue = instance.getStartIndex();
if (startIndexValue != null) {
startIndex(startIndexValue);
}
bits |= 0x4L;
}
if ((bits & 0x10L) == 0) {
SortOrder sortOrderValue = instance.getSortOrder();
if (sortOrderValue != null) {
sortOrder(sortOrderValue);
}
bits |= 0x10L;
}
}
if (object instanceof PaginatedAndSortedByRequest) {
PaginatedAndSortedByRequest instance = (PaginatedAndSortedByRequest) object;
if ((bits & 0x1L) == 0) {
Integer countValue = instance.getCount();
if (countValue != null) {
count(countValue);
}
bits |= 0x1L;
}
if ((bits & 0x2L) == 0) {
String filterValue = instance.getFilter();
if (filterValue != null) {
filter(filterValue);
}
bits |= 0x2L;
}
if ((bits & 0x4L) == 0) {
Integer startIndexValue = instance.getStartIndex();
if (startIndexValue != null) {
startIndex(startIndexValue);
}
bits |= 0x4L;
}
if ((bits & 0x20L) == 0) {
String sortByValue = instance.getSortBy();
if (sortByValue != null) {
sortBy(sortByValue);
}
bits |= 0x20L;
}
if ((bits & 0x10L) == 0) {
SortOrder sortOrderValue = instance.getSortOrder();
if (sortOrderValue != null) {
sortOrder(sortOrderValue);
}
bits |= 0x10L;
}
}
if (object instanceof IdentityZoned) {
IdentityZoned instance = (IdentityZoned) object;
if ((bits & 0x8L) == 0) {
String identityZoneSubdomainValue = instance.getIdentityZoneSubdomain();
if (identityZoneSubdomainValue != null) {
identityZoneSubdomain(identityZoneSubdomainValue);
}
bits |= 0x8L;
}
if ((bits & 0x40L) == 0) {
String identityZoneIdValue = instance.getIdentityZoneId();
if (identityZoneIdValue != null) {
identityZoneId(identityZoneIdValue);
}
bits |= 0x40L;
}
}
}
/**
* Initializes the value for the {@link ListClientsRequest#getIdentityZoneId() identityZoneId} attribute.
* @param identityZoneId The value for identityZoneId (can be {@code null})
* @return {@code this} builder for use in a chained invocation
*/
public final Builder identityZoneId(@Nullable String identityZoneId) {
this.identityZoneId = identityZoneId;
return this;
}
/**
* Initializes the value for the {@link ListClientsRequest#getIdentityZoneSubdomain() identityZoneSubdomain} attribute.
* @param identityZoneSubdomain The value for identityZoneSubdomain (can be {@code null})
* @return {@code this} builder for use in a chained invocation
*/
public final Builder identityZoneSubdomain(@Nullable String identityZoneSubdomain) {
this.identityZoneSubdomain = identityZoneSubdomain;
return this;
}
/**
* Initializes the value for the {@link ListClientsRequest#getCount() count} attribute.
* @param count The value for count (can be {@code null})
* @return {@code this} builder for use in a chained invocation
*/
public final Builder count(@Nullable Integer count) {
this.count = count;
return this;
}
/**
* Initializes the value for the {@link ListClientsRequest#getFilter() filter} attribute.
* @param filter The value for filter (can be {@code null})
* @return {@code this} builder for use in a chained invocation
*/
public final Builder filter(@Nullable String filter) {
this.filter = filter;
return this;
}
/**
* Initializes the value for the {@link ListClientsRequest#getSortOrder() sortOrder} attribute.
* @param sortOrder The value for sortOrder (can be {@code null})
* @return {@code this} builder for use in a chained invocation
*/
public final Builder sortOrder(@Nullable SortOrder sortOrder) {
this.sortOrder = sortOrder;
return this;
}
/**
* Initializes the value for the {@link ListClientsRequest#getStartIndex() startIndex} attribute.
* @param startIndex The value for startIndex (can be {@code null})
* @return {@code this} builder for use in a chained invocation
*/
public final Builder startIndex(@Nullable Integer startIndex) {
this.startIndex = startIndex;
return this;
}
/**
* Initializes the value for the {@link ListClientsRequest#getSortBy() sortBy} attribute.
* @param sortBy The value for sortBy (can be {@code null})
* @return {@code this} builder for use in a chained invocation
*/
public final Builder sortBy(@Nullable String sortBy) {
this.sortBy = sortBy;
return this;
}
/**
* Builds a new {@link ListClientsRequest ListClientsRequest}.
* @return An immutable instance of ListClientsRequest
* @throws java.lang.IllegalStateException if any required attributes are missing
*/
public ListClientsRequest build() {
return new ListClientsRequest(this);
}
}
}