org.cloudfoundry.uaa.groups.ListGroupsRequest Maven / Gradle / Ivy
package org.cloudfoundry.uaa.groups;
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 groups operation
*/
@Generated(from = "_ListGroupsRequest", generator = "Immutables")
@SuppressWarnings({"all"})
@javax.annotation.Generated("org.immutables.processor.ProxyProcessor")
public final class ListGroupsRequest extends org.cloudfoundry.uaa.groups._ListGroupsRequest {
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 ListGroupsRequest(ListGroupsRequest.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 ListGroupsRequest} 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 ListGroupsRequest
&& equalTo(0, (ListGroupsRequest) another);
}
private boolean equalTo(int synthetic, ListGroupsRequest 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 ListGroupsRequest} with attribute values.
* @return A string representation of the value
*/
@Override
public String toString() {
return "ListGroupsRequest{"
+ "identityZoneId=" + identityZoneId
+ ", identityZoneSubdomain=" + identityZoneSubdomain
+ ", count=" + count
+ ", filter=" + filter
+ ", sortOrder=" + sortOrder
+ ", startIndex=" + startIndex
+ ", sortBy=" + sortBy
+ "}";
}
/**
* Creates a builder for {@link ListGroupsRequest ListGroupsRequest}.
*
* ListGroupsRequest.builder()
* .identityZoneId(String | null) // nullable {@link ListGroupsRequest#getIdentityZoneId() identityZoneId}
* .identityZoneSubdomain(String | null) // nullable {@link ListGroupsRequest#getIdentityZoneSubdomain() identityZoneSubdomain}
* .count(Integer | null) // nullable {@link ListGroupsRequest#getCount() count}
* .filter(String | null) // nullable {@link ListGroupsRequest#getFilter() filter}
* .sortOrder(org.cloudfoundry.uaa.SortOrder | null) // nullable {@link ListGroupsRequest#getSortOrder() sortOrder}
* .startIndex(Integer | null) // nullable {@link ListGroupsRequest#getStartIndex() startIndex}
* .sortBy(String | null) // nullable {@link ListGroupsRequest#getSortBy() sortBy}
* .build();
*
* @return A new ListGroupsRequest builder
*/
public static ListGroupsRequest.Builder builder() {
return new ListGroupsRequest.Builder();
}
/**
* Builds instances of type {@link ListGroupsRequest ListGroupsRequest}.
* 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 = "_ListGroupsRequest", 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 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;
}
/**
* Fill a builder with attribute values from the provided {@code ListGroupsRequest} instance.
* @param instance The instance from which to copy values
* @return {@code this} builder for use in a chained invocation
*/
public final Builder from(ListGroupsRequest instance) {
Objects.requireNonNull(instance, "instance");
from((short) 0, (Object) instance);
return this;
}
/**
* Copy abstract value type {@code _ListGroupsRequest} 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(_ListGroupsRequest 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 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;
}
}
if (object instanceof org.cloudfoundry.uaa.groups._ListGroupsRequest) {
org.cloudfoundry.uaa.groups._ListGroupsRequest instance = (org.cloudfoundry.uaa.groups._ListGroupsRequest) 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;
}
}
}
/**
* Initializes the value for the {@link ListGroupsRequest#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 ListGroupsRequest#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 ListGroupsRequest#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 ListGroupsRequest#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 ListGroupsRequest#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 ListGroupsRequest#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 ListGroupsRequest#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 ListGroupsRequest ListGroupsRequest}.
* @return An immutable instance of ListGroupsRequest
* @throws java.lang.IllegalStateException if any required attributes are missing
*/
public ListGroupsRequest build() {
return new ListGroupsRequest(this);
}
}
}