
org.cloudfoundry.uaa.users.LookupUserIdsRequest Maven / Gradle / Ivy
package org.cloudfoundry.uaa.users;
import java.util.Objects;
import org.cloudfoundry.Nullable;
import org.cloudfoundry.uaa.PaginatedAndSortedRequest;
import org.cloudfoundry.uaa.SortOrder;
import org.immutables.value.Generated;
/**
* The request payload for the lookup user ids and usernames operation
*/
@Generated(from = "_LookupUserIdsRequest", generator = "Immutables")
@SuppressWarnings({"all"})
@javax.annotation.Generated("org.immutables.processor.ProxyProcessor")
public final class LookupUserIdsRequest extends org.cloudfoundry.uaa.users._LookupUserIdsRequest {
private final @Nullable Integer count;
private final @Nullable String filter;
private final @Nullable SortOrder sortOrder;
private final @Nullable Integer startIndex;
private final @Nullable Boolean includeInactive;
private LookupUserIdsRequest(LookupUserIdsRequest.Builder builder) {
this.count = builder.count;
this.filter = builder.filter;
this.sortOrder = builder.sortOrder;
this.startIndex = builder.startIndex;
this.includeInactive = builder.includeInactive;
}
/**
* 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;
}
/**
* Whether to include users from inactive identity providers
*/
@Override
public @Nullable Boolean getIncludeInactive() {
return includeInactive;
}
/**
* This instance is equal to all instances of {@code LookupUserIdsRequest} 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 LookupUserIdsRequest
&& equalTo(0, (LookupUserIdsRequest) another);
}
private boolean equalTo(int synthetic, LookupUserIdsRequest another) {
return Objects.equals(count, another.count)
&& Objects.equals(filter, another.filter)
&& Objects.equals(sortOrder, another.sortOrder)
&& Objects.equals(startIndex, another.startIndex)
&& Objects.equals(includeInactive, another.includeInactive);
}
/**
* Computes a hash code from attributes: {@code count}, {@code filter}, {@code sortOrder}, {@code startIndex}, {@code includeInactive}.
* @return hashCode value
*/
@Override
public int hashCode() {
int h = 5381;
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(includeInactive);
return h;
}
/**
* Prints the immutable value {@code LookupUserIdsRequest} with attribute values.
* @return A string representation of the value
*/
@Override
public String toString() {
return "LookupUserIdsRequest{"
+ "count=" + count
+ ", filter=" + filter
+ ", sortOrder=" + sortOrder
+ ", startIndex=" + startIndex
+ ", includeInactive=" + includeInactive
+ "}";
}
/**
* Creates a builder for {@link LookupUserIdsRequest LookupUserIdsRequest}.
*
* LookupUserIdsRequest.builder()
* .count(Integer | null) // nullable {@link LookupUserIdsRequest#getCount() count}
* .filter(String | null) // nullable {@link LookupUserIdsRequest#getFilter() filter}
* .sortOrder(org.cloudfoundry.uaa.SortOrder | null) // nullable {@link LookupUserIdsRequest#getSortOrder() sortOrder}
* .startIndex(Integer | null) // nullable {@link LookupUserIdsRequest#getStartIndex() startIndex}
* .includeInactive(Boolean | null) // nullable {@link LookupUserIdsRequest#getIncludeInactive() includeInactive}
* .build();
*
* @return A new LookupUserIdsRequest builder
*/
public static LookupUserIdsRequest.Builder builder() {
return new LookupUserIdsRequest.Builder();
}
/**
* Builds instances of type {@link LookupUserIdsRequest LookupUserIdsRequest}.
* 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 = "_LookupUserIdsRequest", generator = "Immutables")
public static final class Builder {
private Integer count;
private String filter;
private SortOrder sortOrder;
private Integer startIndex;
private Boolean includeInactive;
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 LookupUserIdsRequest} instance.
* @param instance The instance from which to copy values
* @return {@code this} builder for use in a chained invocation
*/
public final Builder from(LookupUserIdsRequest instance) {
Objects.requireNonNull(instance, "instance");
from((short) 0, (Object) instance);
return this;
}
/**
* Copy abstract value type {@code _LookupUserIdsRequest} 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(_LookupUserIdsRequest instance) {
Objects.requireNonNull(instance, "instance");
from((short) 0, (Object) instance);
return this;
}
private void from(short _unused, Object object) {
if (object instanceof PaginatedAndSortedRequest) {
PaginatedAndSortedRequest instance = (PaginatedAndSortedRequest) object;
Integer countValue = instance.getCount();
if (countValue != null) {
count(countValue);
}
String filterValue = instance.getFilter();
if (filterValue != null) {
filter(filterValue);
}
Integer startIndexValue = instance.getStartIndex();
if (startIndexValue != null) {
startIndex(startIndexValue);
}
SortOrder sortOrderValue = instance.getSortOrder();
if (sortOrderValue != null) {
sortOrder(sortOrderValue);
}
}
if (object instanceof org.cloudfoundry.uaa.users._LookupUserIdsRequest) {
org.cloudfoundry.uaa.users._LookupUserIdsRequest instance = (org.cloudfoundry.uaa.users._LookupUserIdsRequest) object;
Boolean includeInactiveValue = instance.getIncludeInactive();
if (includeInactiveValue != null) {
includeInactive(includeInactiveValue);
}
}
}
/**
* Initializes the value for the {@link LookupUserIdsRequest#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 LookupUserIdsRequest#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 LookupUserIdsRequest#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 LookupUserIdsRequest#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 LookupUserIdsRequest#getIncludeInactive() includeInactive} attribute.
* @param includeInactive The value for includeInactive (can be {@code null})
* @return {@code this} builder for use in a chained invocation
*/
public final Builder includeInactive(@Nullable Boolean includeInactive) {
this.includeInactive = includeInactive;
return this;
}
/**
* Builds a new {@link LookupUserIdsRequest LookupUserIdsRequest}.
* @return An immutable instance of LookupUserIdsRequest
* @throws java.lang.IllegalStateException if any required attributes are missing
*/
public LookupUserIdsRequest build() {
return new LookupUserIdsRequest(this);
}
}
}