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

org.cloudfoundry.operations.services.DeleteServiceKeyRequest Maven / Gradle / Ivy

There is a newer version: 5.12.2.RELEASE
Show newest version
package org.cloudfoundry.operations.services;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import org.immutables.value.Generated;

/**
 * The request options for the deleting the service key
 */
@Generated(from = "_DeleteServiceKeyRequest", generator = "Immutables")
@SuppressWarnings({"all"})
@javax.annotation.Generated("org.immutables.processor.ProxyProcessor")
public final class DeleteServiceKeyRequest
    extends org.cloudfoundry.operations.services._DeleteServiceKeyRequest {
  private final String serviceInstanceName;
  private final String serviceKeyName;

  private DeleteServiceKeyRequest(DeleteServiceKeyRequest.Builder builder) {
    this.serviceInstanceName = builder.serviceInstanceName;
    this.serviceKeyName = builder.serviceKeyName;
  }

  /**
   * The name of the service instance
   */
  @Override
  public String getServiceInstanceName() {
    return serviceInstanceName;
  }

  /**
   * The name of the service key to delete
   */
  @Override
  public String getServiceKeyName() {
    return serviceKeyName;
  }

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

  private boolean equalTo(DeleteServiceKeyRequest another) {
    return serviceInstanceName.equals(another.serviceInstanceName)
        && serviceKeyName.equals(another.serviceKeyName);
  }

  /**
   * Computes a hash code from attributes: {@code serviceInstanceName}, {@code serviceKeyName}.
   * @return hashCode value
   */
  @Override
  public int hashCode() {
    int h = 5381;
    h += (h << 5) + serviceInstanceName.hashCode();
    h += (h << 5) + serviceKeyName.hashCode();
    return h;
  }

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

  /**
   * Creates a builder for {@link DeleteServiceKeyRequest DeleteServiceKeyRequest}.
   * @return A new DeleteServiceKeyRequest builder
   */
  public static DeleteServiceKeyRequest.Builder builder() {
    return new DeleteServiceKeyRequest.Builder();
  }

  /**
   * Builds instances of type {@link DeleteServiceKeyRequest DeleteServiceKeyRequest}.
   * 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 = "_DeleteServiceKeyRequest", generator = "Immutables") public static final class Builder { private static final long INIT_BIT_SERVICE_INSTANCE_NAME = 0x1L; private static final long INIT_BIT_SERVICE_KEY_NAME = 0x2L; private long initBits = 0x3L; private String serviceInstanceName; private String serviceKeyName; private Builder() { } /** * Fill a builder with attribute values from the provided {@code DeleteServiceKeyRequest} 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 */ public final Builder from(DeleteServiceKeyRequest instance) { return from((_DeleteServiceKeyRequest) instance); } /** * Copy abstract value type {@code _DeleteServiceKeyRequest} instance into builder. * @param instance The instance from which to copy values * @return {@code this} builder for use in a chained invocation */ final Builder from(_DeleteServiceKeyRequest instance) { Objects.requireNonNull(instance, "instance"); serviceInstanceName(instance.getServiceInstanceName()); serviceKeyName(instance.getServiceKeyName()); return this; } /** * Initializes the value for the {@link DeleteServiceKeyRequest#getServiceInstanceName() serviceInstanceName} attribute. * @param serviceInstanceName The value for serviceInstanceName * @return {@code this} builder for use in a chained invocation */ public final Builder serviceInstanceName(String serviceInstanceName) { this.serviceInstanceName = Objects.requireNonNull(serviceInstanceName, "serviceInstanceName"); initBits &= ~INIT_BIT_SERVICE_INSTANCE_NAME; return this; } /** * Initializes the value for the {@link DeleteServiceKeyRequest#getServiceKeyName() serviceKeyName} attribute. * @param serviceKeyName The value for serviceKeyName * @return {@code this} builder for use in a chained invocation */ public final Builder serviceKeyName(String serviceKeyName) { this.serviceKeyName = Objects.requireNonNull(serviceKeyName, "serviceKeyName"); initBits &= ~INIT_BIT_SERVICE_KEY_NAME; return this; } /** * Builds a new {@link DeleteServiceKeyRequest DeleteServiceKeyRequest}. * @return An immutable instance of DeleteServiceKeyRequest * @throws java.lang.IllegalStateException if any required attributes are missing */ public DeleteServiceKeyRequest build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return new DeleteServiceKeyRequest(this); } private String formatRequiredAttributesMessage() { List attributes = new ArrayList<>(); if ((initBits & INIT_BIT_SERVICE_INSTANCE_NAME) != 0) attributes.add("serviceInstanceName"); if ((initBits & INIT_BIT_SERVICE_KEY_NAME) != 0) attributes.add("serviceKeyName"); return "Cannot build DeleteServiceKeyRequest, some of required attributes are not set " + attributes; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy