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

software.amazon.awssdk.services.mq.model.BrokerSummary Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AmazonMQ module holds the client classes that are used for communicating with AmazonMQ Service

There is a newer version: 2.28.4
Show newest version
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.mq.model;

import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.TimestampFormatTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Returns information about all brokers. *

*/ @Generated("software.amazon.awssdk:codegen") public final class BrokerSummary implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField BROKER_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("BrokerArn").getter(getter(BrokerSummary::brokerArn)).setter(setter(Builder::brokerArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("brokerArn").build()).build(); private static final SdkField BROKER_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("BrokerId").getter(getter(BrokerSummary::brokerId)).setter(setter(Builder::brokerId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("brokerId").build()).build(); private static final SdkField BROKER_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("BrokerName").getter(getter(BrokerSummary::brokerName)).setter(setter(Builder::brokerName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("brokerName").build()).build(); private static final SdkField BROKER_STATE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("BrokerState").getter(getter(BrokerSummary::brokerStateAsString)).setter(setter(Builder::brokerState)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("brokerState").build()).build(); private static final SdkField CREATED_FIELD = SdkField . builder(MarshallingType.INSTANT) .memberName("Created") .getter(getter(BrokerSummary::created)) .setter(setter(Builder::created)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("created").build(), TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build(); private static final SdkField DEPLOYMENT_MODE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("DeploymentMode").getter(getter(BrokerSummary::deploymentModeAsString)) .setter(setter(Builder::deploymentMode)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("deploymentMode").build()).build(); private static final SdkField ENGINE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("EngineType").getter(getter(BrokerSummary::engineTypeAsString)).setter(setter(Builder::engineType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("engineType").build()).build(); private static final SdkField HOST_INSTANCE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("HostInstanceType").getter(getter(BrokerSummary::hostInstanceType)) .setter(setter(Builder::hostInstanceType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("hostInstanceType").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BROKER_ARN_FIELD, BROKER_ID_FIELD, BROKER_NAME_FIELD, BROKER_STATE_FIELD, CREATED_FIELD, DEPLOYMENT_MODE_FIELD, ENGINE_TYPE_FIELD, HOST_INSTANCE_TYPE_FIELD)); private static final long serialVersionUID = 1L; private final String brokerArn; private final String brokerId; private final String brokerName; private final String brokerState; private final Instant created; private final String deploymentMode; private final String engineType; private final String hostInstanceType; private BrokerSummary(BuilderImpl builder) { this.brokerArn = builder.brokerArn; this.brokerId = builder.brokerId; this.brokerName = builder.brokerName; this.brokerState = builder.brokerState; this.created = builder.created; this.deploymentMode = builder.deploymentMode; this.engineType = builder.engineType; this.hostInstanceType = builder.hostInstanceType; } /** *

* The broker's Amazon Resource Name (ARN). *

* * @return The broker's Amazon Resource Name (ARN). */ public final String brokerArn() { return brokerArn; } /** *

* The unique ID that Amazon MQ generates for the broker. *

* * @return The unique ID that Amazon MQ generates for the broker. */ public final String brokerId() { return brokerId; } /** *

* The broker's name. This value is unique in your Amazon Web Services account, 1-50 characters long, and containing * only letters, numbers, dashes, and underscores, and must not contain white spaces, brackets, wildcard characters, * or special characters. *

* * @return The broker's name. This value is unique in your Amazon Web Services account, 1-50 characters long, and * containing only letters, numbers, dashes, and underscores, and must not contain white spaces, brackets, * wildcard characters, or special characters. */ public final String brokerName() { return brokerName; } /** *

* The broker's status. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #brokerState} will * return {@link BrokerState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #brokerStateAsString}. *

* * @return The broker's status. * @see BrokerState */ public final BrokerState brokerState() { return BrokerState.fromValue(brokerState); } /** *

* The broker's status. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #brokerState} will * return {@link BrokerState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #brokerStateAsString}. *

* * @return The broker's status. * @see BrokerState */ public final String brokerStateAsString() { return brokerState; } /** *

* The time when the broker was created. *

* * @return The time when the broker was created. */ public final Instant created() { return created; } /** *

* The broker's deployment mode. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #deploymentMode} * will return {@link DeploymentMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #deploymentModeAsString}. *

* * @return The broker's deployment mode. * @see DeploymentMode */ public final DeploymentMode deploymentMode() { return DeploymentMode.fromValue(deploymentMode); } /** *

* The broker's deployment mode. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #deploymentMode} * will return {@link DeploymentMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #deploymentModeAsString}. *

* * @return The broker's deployment mode. * @see DeploymentMode */ public final String deploymentModeAsString() { return deploymentMode; } /** *

* The type of broker engine. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #engineType} will * return {@link EngineType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #engineTypeAsString}. *

* * @return The type of broker engine. * @see EngineType */ public final EngineType engineType() { return EngineType.fromValue(engineType); } /** *

* The type of broker engine. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #engineType} will * return {@link EngineType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #engineTypeAsString}. *

* * @return The type of broker engine. * @see EngineType */ public final String engineTypeAsString() { return engineType; } /** *

* The broker's instance type. *

* * @return The broker's instance type. */ public final String hostInstanceType() { return hostInstanceType; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(brokerArn()); hashCode = 31 * hashCode + Objects.hashCode(brokerId()); hashCode = 31 * hashCode + Objects.hashCode(brokerName()); hashCode = 31 * hashCode + Objects.hashCode(brokerStateAsString()); hashCode = 31 * hashCode + Objects.hashCode(created()); hashCode = 31 * hashCode + Objects.hashCode(deploymentModeAsString()); hashCode = 31 * hashCode + Objects.hashCode(engineTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(hostInstanceType()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof BrokerSummary)) { return false; } BrokerSummary other = (BrokerSummary) obj; return Objects.equals(brokerArn(), other.brokerArn()) && Objects.equals(brokerId(), other.brokerId()) && Objects.equals(brokerName(), other.brokerName()) && Objects.equals(brokerStateAsString(), other.brokerStateAsString()) && Objects.equals(created(), other.created()) && Objects.equals(deploymentModeAsString(), other.deploymentModeAsString()) && Objects.equals(engineTypeAsString(), other.engineTypeAsString()) && Objects.equals(hostInstanceType(), other.hostInstanceType()); } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public final String toString() { return ToString.builder("BrokerSummary").add("BrokerArn", brokerArn()).add("BrokerId", brokerId()) .add("BrokerName", brokerName()).add("BrokerState", brokerStateAsString()).add("Created", created()) .add("DeploymentMode", deploymentModeAsString()).add("EngineType", engineTypeAsString()) .add("HostInstanceType", hostInstanceType()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "BrokerArn": return Optional.ofNullable(clazz.cast(brokerArn())); case "BrokerId": return Optional.ofNullable(clazz.cast(brokerId())); case "BrokerName": return Optional.ofNullable(clazz.cast(brokerName())); case "BrokerState": return Optional.ofNullable(clazz.cast(brokerStateAsString())); case "Created": return Optional.ofNullable(clazz.cast(created())); case "DeploymentMode": return Optional.ofNullable(clazz.cast(deploymentModeAsString())); case "EngineType": return Optional.ofNullable(clazz.cast(engineTypeAsString())); case "HostInstanceType": return Optional.ofNullable(clazz.cast(hostInstanceType())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((BrokerSummary) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The broker's Amazon Resource Name (ARN). *

* * @param brokerArn * The broker's Amazon Resource Name (ARN). * @return Returns a reference to this object so that method calls can be chained together. */ Builder brokerArn(String brokerArn); /** *

* The unique ID that Amazon MQ generates for the broker. *

* * @param brokerId * The unique ID that Amazon MQ generates for the broker. * @return Returns a reference to this object so that method calls can be chained together. */ Builder brokerId(String brokerId); /** *

* The broker's name. This value is unique in your Amazon Web Services account, 1-50 characters long, and * containing only letters, numbers, dashes, and underscores, and must not contain white spaces, brackets, * wildcard characters, or special characters. *

* * @param brokerName * The broker's name. This value is unique in your Amazon Web Services account, 1-50 characters long, and * containing only letters, numbers, dashes, and underscores, and must not contain white spaces, * brackets, wildcard characters, or special characters. * @return Returns a reference to this object so that method calls can be chained together. */ Builder brokerName(String brokerName); /** *

* The broker's status. *

* * @param brokerState * The broker's status. * @see BrokerState * @return Returns a reference to this object so that method calls can be chained together. * @see BrokerState */ Builder brokerState(String brokerState); /** *

* The broker's status. *

* * @param brokerState * The broker's status. * @see BrokerState * @return Returns a reference to this object so that method calls can be chained together. * @see BrokerState */ Builder brokerState(BrokerState brokerState); /** *

* The time when the broker was created. *

* * @param created * The time when the broker was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder created(Instant created); /** *

* The broker's deployment mode. *

* * @param deploymentMode * The broker's deployment mode. * @see DeploymentMode * @return Returns a reference to this object so that method calls can be chained together. * @see DeploymentMode */ Builder deploymentMode(String deploymentMode); /** *

* The broker's deployment mode. *

* * @param deploymentMode * The broker's deployment mode. * @see DeploymentMode * @return Returns a reference to this object so that method calls can be chained together. * @see DeploymentMode */ Builder deploymentMode(DeploymentMode deploymentMode); /** *

* The type of broker engine. *

* * @param engineType * The type of broker engine. * @see EngineType * @return Returns a reference to this object so that method calls can be chained together. * @see EngineType */ Builder engineType(String engineType); /** *

* The type of broker engine. *

* * @param engineType * The type of broker engine. * @see EngineType * @return Returns a reference to this object so that method calls can be chained together. * @see EngineType */ Builder engineType(EngineType engineType); /** *

* The broker's instance type. *

* * @param hostInstanceType * The broker's instance type. * @return Returns a reference to this object so that method calls can be chained together. */ Builder hostInstanceType(String hostInstanceType); } static final class BuilderImpl implements Builder { private String brokerArn; private String brokerId; private String brokerName; private String brokerState; private Instant created; private String deploymentMode; private String engineType; private String hostInstanceType; private BuilderImpl() { } private BuilderImpl(BrokerSummary model) { brokerArn(model.brokerArn); brokerId(model.brokerId); brokerName(model.brokerName); brokerState(model.brokerState); created(model.created); deploymentMode(model.deploymentMode); engineType(model.engineType); hostInstanceType(model.hostInstanceType); } public final String getBrokerArn() { return brokerArn; } public final void setBrokerArn(String brokerArn) { this.brokerArn = brokerArn; } @Override public final Builder brokerArn(String brokerArn) { this.brokerArn = brokerArn; return this; } public final String getBrokerId() { return brokerId; } public final void setBrokerId(String brokerId) { this.brokerId = brokerId; } @Override public final Builder brokerId(String brokerId) { this.brokerId = brokerId; return this; } public final String getBrokerName() { return brokerName; } public final void setBrokerName(String brokerName) { this.brokerName = brokerName; } @Override public final Builder brokerName(String brokerName) { this.brokerName = brokerName; return this; } public final String getBrokerState() { return brokerState; } public final void setBrokerState(String brokerState) { this.brokerState = brokerState; } @Override public final Builder brokerState(String brokerState) { this.brokerState = brokerState; return this; } @Override public final Builder brokerState(BrokerState brokerState) { this.brokerState(brokerState == null ? null : brokerState.toString()); return this; } public final Instant getCreated() { return created; } public final void setCreated(Instant created) { this.created = created; } @Override public final Builder created(Instant created) { this.created = created; return this; } public final String getDeploymentMode() { return deploymentMode; } public final void setDeploymentMode(String deploymentMode) { this.deploymentMode = deploymentMode; } @Override public final Builder deploymentMode(String deploymentMode) { this.deploymentMode = deploymentMode; return this; } @Override public final Builder deploymentMode(DeploymentMode deploymentMode) { this.deploymentMode(deploymentMode == null ? null : deploymentMode.toString()); return this; } public final String getEngineType() { return engineType; } public final void setEngineType(String engineType) { this.engineType = engineType; } @Override public final Builder engineType(String engineType) { this.engineType = engineType; return this; } @Override public final Builder engineType(EngineType engineType) { this.engineType(engineType == null ? null : engineType.toString()); return this; } public final String getHostInstanceType() { return hostInstanceType; } public final void setHostInstanceType(String hostInstanceType) { this.hostInstanceType = hostInstanceType; } @Override public final Builder hostInstanceType(String hostInstanceType) { this.hostInstanceType = hostInstanceType; return this; } @Override public BrokerSummary build() { return new BrokerSummary(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy