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

org.cloudfoundry.client.v3.applications.GetApplicationFeatureResponse Maven / Gradle / Ivy

There is a newer version: 5.12.2.RELEASE
Show newest version
package org.cloudfoundry.client.v3.applications;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import java.util.Objects;
import org.cloudfoundry.Nullable;
import org.immutables.value.Generated;

/**
 * The response payload for the Get Application Feature operation
 */
@Generated(from = "_GetApplicationFeatureResponse", generator = "Immutables")
@SuppressWarnings({"all"})
@javax.annotation.Generated("org.immutables.processor.ProxyProcessor")
public final class GetApplicationFeatureResponse
    extends org.cloudfoundry.client.v3.applications._GetApplicationFeatureResponse {
  private final @Nullable String description;
  private final @Nullable Boolean enabled;
  private final @Nullable String name;

  private GetApplicationFeatureResponse(GetApplicationFeatureResponse.Builder builder) {
    this.description = builder.description;
    this.enabled = builder.enabled;
    this.name = builder.name;
  }

  /**
   * The description of the application feature
   */
  @JsonProperty("description")
  @Override
  public @Nullable String getDescription() {
    return description;
  }

  /**
   * Denotes whether or not the application feature is enabled
   */
  @JsonProperty("enabled")
  @Override
  public @Nullable Boolean getEnabled() {
    return enabled;
  }

  /**
   * The name of the application feature
   */
  @JsonProperty("name")
  @Override
  public @Nullable String getName() {
    return name;
  }

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

  private boolean equalTo(int synthetic, GetApplicationFeatureResponse another) {
    return Objects.equals(description, another.description)
        && Objects.equals(enabled, another.enabled)
        && Objects.equals(name, another.name);
  }

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

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

  /**
   * Utility type used to correctly read immutable object from JSON representation.
   * @deprecated Do not use this type directly, it exists only for the Jackson-binding infrastructure
   */
  @Generated(from = "_GetApplicationFeatureResponse", generator = "Immutables")
  @Deprecated
  @JsonDeserialize
  @JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.NONE)
  static final class Json extends org.cloudfoundry.client.v3.applications._GetApplicationFeatureResponse {
    String description;
    Boolean enabled;
    String name;
    @JsonProperty("description")
    public void setDescription(@Nullable String description) {
      this.description = description;
    }
    @JsonProperty("enabled")
    public void setEnabled(@Nullable Boolean enabled) {
      this.enabled = enabled;
    }
    @JsonProperty("name")
    public void setName(@Nullable String name) {
      this.name = name;
    }
    @Override
    public String getDescription() { throw new UnsupportedOperationException(); }
    @Override
    public Boolean getEnabled() { throw new UnsupportedOperationException(); }
    @Override
    public String getName() { throw new UnsupportedOperationException(); }
  }

  /**
   * @param json A JSON-bindable data structure
   * @return An immutable value type
   * @deprecated Do not use this method directly, it exists only for the Jackson-binding infrastructure
   */
  @Deprecated
  @JsonCreator(mode = JsonCreator.Mode.DELEGATING)
  static GetApplicationFeatureResponse fromJson(Json json) {
    GetApplicationFeatureResponse.Builder builder = GetApplicationFeatureResponse.builder();
    if (json.description != null) {
      builder.description(json.description);
    }
    if (json.enabled != null) {
      builder.enabled(json.enabled);
    }
    if (json.name != null) {
      builder.name(json.name);
    }
    return builder.build();
  }

  /**
   * Creates a builder for {@link GetApplicationFeatureResponse GetApplicationFeatureResponse}.
   * 
   * GetApplicationFeatureResponse.builder()
   *    .description(String | null) // nullable {@link GetApplicationFeatureResponse#getDescription() description}
   *    .enabled(Boolean | null) // nullable {@link GetApplicationFeatureResponse#getEnabled() enabled}
   *    .name(String | null) // nullable {@link GetApplicationFeatureResponse#getName() name}
   *    .build();
   * 
* @return A new GetApplicationFeatureResponse builder */ public static GetApplicationFeatureResponse.Builder builder() { return new GetApplicationFeatureResponse.Builder(); } /** * Builds instances of type {@link GetApplicationFeatureResponse GetApplicationFeatureResponse}. * 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 = "_GetApplicationFeatureResponse", generator = "Immutables") public static final class Builder { private String description; private Boolean enabled; private String name; private Builder() { } /** * Fill a builder with attribute values from the provided {@code org.cloudfoundry.client.v3.applications.ApplicationFeature} instance. * @param instance The instance from which to copy values * @return {@code this} builder for use in a chained invocation */ public final Builder from(ApplicationFeature instance) { Objects.requireNonNull(instance, "instance"); from((short) 0, (Object) instance); return this; } /** * Fill a builder with attribute values from the provided {@code GetApplicationFeatureResponse} instance. * @param instance The instance from which to copy values * @return {@code this} builder for use in a chained invocation */ public final Builder from(GetApplicationFeatureResponse instance) { Objects.requireNonNull(instance, "instance"); from((short) 0, (Object) instance); return this; } /** * Copy abstract value type {@code _GetApplicationFeatureResponse} 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(_GetApplicationFeatureResponse instance) { Objects.requireNonNull(instance, "instance"); from((short) 0, (Object) instance); return this; } private void from(short _unused, Object object) { if (object instanceof ApplicationFeature) { ApplicationFeature instance = (ApplicationFeature) object; String nameValue = instance.getName(); if (nameValue != null) { name(nameValue); } String descriptionValue = instance.getDescription(); if (descriptionValue != null) { description(descriptionValue); } Boolean enabledValue = instance.getEnabled(); if (enabledValue != null) { enabled(enabledValue); } } } /** * Initializes the value for the {@link GetApplicationFeatureResponse#getDescription() description} attribute. * @param description The value for description (can be {@code null}) * @return {@code this} builder for use in a chained invocation */ @JsonProperty("description") public final Builder description(@Nullable String description) { this.description = description; return this; } /** * Initializes the value for the {@link GetApplicationFeatureResponse#getEnabled() enabled} attribute. * @param enabled The value for enabled (can be {@code null}) * @return {@code this} builder for use in a chained invocation */ @JsonProperty("enabled") public final Builder enabled(@Nullable Boolean enabled) { this.enabled = enabled; return this; } /** * Initializes the value for the {@link GetApplicationFeatureResponse#getName() name} attribute. * @param name The value for name (can be {@code null}) * @return {@code this} builder for use in a chained invocation */ @JsonProperty("name") public final Builder name(@Nullable String name) { this.name = name; return this; } /** * Builds a new {@link GetApplicationFeatureResponse GetApplicationFeatureResponse}. * @return An immutable instance of GetApplicationFeatureResponse * @throws java.lang.IllegalStateException if any required attributes are missing */ public GetApplicationFeatureResponse build() { return new GetApplicationFeatureResponse(this); } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy