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

org.cloudfoundry.client.v2.routemappings.GetRouteMappingResponse Maven / Gradle / Ivy

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

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.cloudfoundry.client.v2.Metadata;
import org.immutables.value.Generated;

/**
 * The response payload for the Get a Route Mapping operation
 */
@Generated(from = "_GetRouteMappingResponse", generator = "Immutables")
@SuppressWarnings({"all"})
@javax.annotation.Generated("org.immutables.processor.ProxyProcessor")
public final class GetRouteMappingResponse
    extends org.cloudfoundry.client.v2.routemappings._GetRouteMappingResponse {
  private final @Nullable RouteMappingEntity entity;
  private final @Nullable Metadata metadata;

  private GetRouteMappingResponse(GetRouteMappingResponse.Builder builder) {
    this.entity = builder.entity;
    this.metadata = builder.metadata;
  }

  /**
   * The resource's entity
   */
  @JsonProperty("entity")
  @Override
  public @Nullable RouteMappingEntity getEntity() {
    return entity;
  }

  /**
   * The resource's metadata
   */
  @JsonProperty("metadata")
  @Override
  public @Nullable Metadata getMetadata() {
    return metadata;
  }

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

  private boolean equalTo(int synthetic, GetRouteMappingResponse another) {
    return Objects.equals(entity, another.entity)
        && Objects.equals(metadata, another.metadata);
  }

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

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

  /**
   * 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 = "_GetRouteMappingResponse", generator = "Immutables")
  @Deprecated
  @JsonDeserialize
  @JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.NONE)
  static final class Json extends org.cloudfoundry.client.v2.routemappings._GetRouteMappingResponse {
    RouteMappingEntity entity;
    Metadata metadata;
    @JsonProperty("entity")
    public void setEntity(@Nullable RouteMappingEntity entity) {
      this.entity = entity;
    }
    @JsonProperty("metadata")
    public void setMetadata(@Nullable Metadata metadata) {
      this.metadata = metadata;
    }
    @Override
    public RouteMappingEntity getEntity() { throw new UnsupportedOperationException(); }
    @Override
    public Metadata getMetadata() { 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 GetRouteMappingResponse fromJson(Json json) {
    GetRouteMappingResponse.Builder builder = GetRouteMappingResponse.builder();
    if (json.entity != null) {
      builder.entity(json.entity);
    }
    if (json.metadata != null) {
      builder.metadata(json.metadata);
    }
    return builder.build();
  }

  /**
   * Creates a builder for {@link GetRouteMappingResponse GetRouteMappingResponse}.
   * 
   * GetRouteMappingResponse.builder()
   *    .entity(org.cloudfoundry.client.v2.routemappings.RouteMappingEntity | null) // nullable {@link GetRouteMappingResponse#getEntity() entity}
   *    .metadata(org.cloudfoundry.client.v2.Metadata | null) // nullable {@link GetRouteMappingResponse#getMetadata() metadata}
   *    .build();
   * 
* @return A new GetRouteMappingResponse builder */ public static GetRouteMappingResponse.Builder builder() { return new GetRouteMappingResponse.Builder(); } /** * Builds instances of type {@link GetRouteMappingResponse GetRouteMappingResponse}. * 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 = "_GetRouteMappingResponse", generator = "Immutables") public static final class Builder { private RouteMappingEntity entity; private Metadata metadata; private Builder() { } /** * Fill a builder with attribute values from the provided {@code org.cloudfoundry.client.v2.routemappings.AbstractRouteMappingResource} instance. * @param instance The instance from which to copy values * @return {@code this} builder for use in a chained invocation */ public final Builder from(AbstractRouteMappingResource instance) { Objects.requireNonNull(instance, "instance"); from((short) 0, (Object) instance); return this; } /** * Fill a builder with attribute values from the provided {@code GetRouteMappingResponse} instance. * @param instance The instance from which to copy values * @return {@code this} builder for use in a chained invocation */ public final Builder from(GetRouteMappingResponse instance) { Objects.requireNonNull(instance, "instance"); from((short) 0, (Object) instance); return this; } /** * Copy abstract value type {@code _GetRouteMappingResponse} 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(_GetRouteMappingResponse 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 AbstractRouteMappingResource) { AbstractRouteMappingResource instance = (AbstractRouteMappingResource) object; if ((bits & 0x1L) == 0) { Metadata metadataValue = instance.getMetadata(); if (metadataValue != null) { metadata(metadataValue); } bits |= 0x1L; } } if (object instanceof org.cloudfoundry.client.v2.routemappings._GetRouteMappingResponse) { org.cloudfoundry.client.v2.routemappings._GetRouteMappingResponse instance = (org.cloudfoundry.client.v2.routemappings._GetRouteMappingResponse) object; if ((bits & 0x1L) == 0) { Metadata metadataValue = instance.getMetadata(); if (metadataValue != null) { metadata(metadataValue); } bits |= 0x1L; } RouteMappingEntity entityValue = instance.getEntity(); if (entityValue != null) { entity(entityValue); } } } /** * Initializes the value for the {@link GetRouteMappingResponse#getEntity() entity} attribute. * @param entity The value for entity (can be {@code null}) * @return {@code this} builder for use in a chained invocation */ @JsonProperty("entity") public final Builder entity(@Nullable RouteMappingEntity entity) { this.entity = entity; return this; } /** * Initializes the value for the {@link GetRouteMappingResponse#getMetadata() metadata} attribute. * @param metadata The value for metadata (can be {@code null}) * @return {@code this} builder for use in a chained invocation */ @JsonProperty("metadata") public final Builder metadata(@Nullable Metadata metadata) { this.metadata = metadata; return this; } /** * Builds a new {@link GetRouteMappingResponse GetRouteMappingResponse}. * @return An immutable instance of GetRouteMappingResponse * @throws java.lang.IllegalStateException if any required attributes are missing */ public GetRouteMappingResponse build() { return new GetRouteMappingResponse(this); } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy