All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.cloudfoundry.uaa.clients.GetClientRequest Maven / Gradle / Ivy

There is a newer version: 5.12.2.RELEASE
Show newest version
package org.cloudfoundry.uaa.clients;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import org.cloudfoundry.Nullable;
import org.cloudfoundry.uaa.IdentityZoned;
import org.immutables.value.Generated;

/**
 * The request payload for Get Client
 */
@Generated(from = "_GetClientRequest", generator = "Immutables")
@SuppressWarnings({"all"})
@javax.annotation.Generated("org.immutables.processor.ProxyProcessor")
public final class GetClientRequest extends org.cloudfoundry.uaa.clients._GetClientRequest {
  private final @Nullable String identityZoneId;
  private final @Nullable String identityZoneSubdomain;
  private final String clientId;

  private GetClientRequest(GetClientRequest.Builder builder) {
    this.identityZoneId = builder.identityZoneId;
    this.identityZoneSubdomain = builder.identityZoneSubdomain;
    this.clientId = builder.clientId;
  }

  /**
   * 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 client id
   */
  @Override
  public String getClientId() {
    return clientId;
  }

  /**
   * This instance is equal to all instances of {@code GetClientRequest} 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 GetClientRequest
        && equalTo(0, (GetClientRequest) another);
  }

  private boolean equalTo(int synthetic, GetClientRequest another) {
    return Objects.equals(identityZoneId, another.identityZoneId)
        && Objects.equals(identityZoneSubdomain, another.identityZoneSubdomain)
        && clientId.equals(another.clientId);
  }

  /**
   * Computes a hash code from attributes: {@code identityZoneId}, {@code identityZoneSubdomain}, {@code clientId}.
   * @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) + clientId.hashCode();
    return h;
  }

  /**
   * Prints the immutable value {@code GetClientRequest} with attribute values.
   * @return A string representation of the value
   */
  @Override
  public String toString() {
    return "GetClientRequest{"
        + "identityZoneId=" + identityZoneId
        + ", identityZoneSubdomain=" + identityZoneSubdomain
        + ", clientId=" + clientId
        + "}";
  }

  /**
   * Creates a builder for {@link GetClientRequest GetClientRequest}.
   * 
   * GetClientRequest.builder()
   *    .identityZoneId(String | null) // nullable {@link GetClientRequest#getIdentityZoneId() identityZoneId}
   *    .identityZoneSubdomain(String | null) // nullable {@link GetClientRequest#getIdentityZoneSubdomain() identityZoneSubdomain}
   *    .clientId(String) // required {@link GetClientRequest#getClientId() clientId}
   *    .build();
   * 
* @return A new GetClientRequest builder */ public static GetClientRequest.Builder builder() { return new GetClientRequest.Builder(); } /** * Builds instances of type {@link GetClientRequest GetClientRequest}. * 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 = "_GetClientRequest", generator = "Immutables") public static final class Builder { private static final long INIT_BIT_CLIENT_ID = 0x1L; private long initBits = 0x1L; private String identityZoneId; private String identityZoneSubdomain; private String clientId; private Builder() { } /** * 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 GetClientRequest} instance. * @param instance The instance from which to copy values * @return {@code this} builder for use in a chained invocation */ public final Builder from(GetClientRequest instance) { Objects.requireNonNull(instance, "instance"); from((short) 0, (Object) instance); return this; } /** * Copy abstract value type {@code _GetClientRequest} 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(_GetClientRequest instance) { Objects.requireNonNull(instance, "instance"); from((short) 0, (Object) instance); return this; } private void from(short _unused, Object object) { if (object instanceof IdentityZoned) { IdentityZoned instance = (IdentityZoned) object; String identityZoneSubdomainValue = instance.getIdentityZoneSubdomain(); if (identityZoneSubdomainValue != null) { identityZoneSubdomain(identityZoneSubdomainValue); } String identityZoneIdValue = instance.getIdentityZoneId(); if (identityZoneIdValue != null) { identityZoneId(identityZoneIdValue); } } if (object instanceof org.cloudfoundry.uaa.clients._GetClientRequest) { org.cloudfoundry.uaa.clients._GetClientRequest instance = (org.cloudfoundry.uaa.clients._GetClientRequest) object; clientId(instance.getClientId()); } } /** * Initializes the value for the {@link GetClientRequest#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 GetClientRequest#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 GetClientRequest#getClientId() clientId} attribute. * @param clientId The value for clientId * @return {@code this} builder for use in a chained invocation */ public final Builder clientId(String clientId) { this.clientId = Objects.requireNonNull(clientId, "clientId"); initBits &= ~INIT_BIT_CLIENT_ID; return this; } /** * Builds a new {@link GetClientRequest GetClientRequest}. * @return An immutable instance of GetClientRequest * @throws java.lang.IllegalStateException if any required attributes are missing */ public GetClientRequest build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return new GetClientRequest(this); } private String formatRequiredAttributesMessage() { List attributes = new ArrayList<>(); if ((initBits & INIT_BIT_CLIENT_ID) != 0) attributes.add("clientId"); return "Cannot build GetClientRequest, some of required attributes are not set " + attributes; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy