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

software.amazon.awssdk.services.kafka.model.NodeInfo Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Kafka module holds the client classes that are used for communicating with Kafka.

There is a newer version: 2.29.15
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.kafka.model;

import java.io.Serializable;
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.Consumer;
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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 *
 * 

* The node information object. *

* */ @Generated("software.amazon.awssdk:codegen") public final class NodeInfo implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ADDED_TO_CLUSTER_TIME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("AddedToClusterTime").getter(getter(NodeInfo::addedToClusterTime)) .setter(setter(Builder::addedToClusterTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("addedToClusterTime").build()) .build(); private static final SdkField BROKER_NODE_INFO_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("BrokerNodeInfo") .getter(getter(NodeInfo::brokerNodeInfo)).setter(setter(Builder::brokerNodeInfo)) .constructor(BrokerNodeInfo::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("brokerNodeInfo").build()).build(); private static final SdkField CONTROLLER_NODE_INFO_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("ControllerNodeInfo") .getter(getter(NodeInfo::controllerNodeInfo)).setter(setter(Builder::controllerNodeInfo)) .constructor(ControllerNodeInfo::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("controllerNodeInfo").build()) .build(); private static final SdkField INSTANCE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("InstanceType").getter(getter(NodeInfo::instanceType)).setter(setter(Builder::instanceType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("instanceType").build()).build(); private static final SdkField NODE_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("NodeARN").getter(getter(NodeInfo::nodeARN)).setter(setter(Builder::nodeARN)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("nodeARN").build()).build(); private static final SdkField NODE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("NodeType").getter(getter(NodeInfo::nodeTypeAsString)).setter(setter(Builder::nodeType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("nodeType").build()).build(); private static final SdkField ZOOKEEPER_NODE_INFO_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("ZookeeperNodeInfo") .getter(getter(NodeInfo::zookeeperNodeInfo)).setter(setter(Builder::zookeeperNodeInfo)) .constructor(ZookeeperNodeInfo::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("zookeeperNodeInfo").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ADDED_TO_CLUSTER_TIME_FIELD, BROKER_NODE_INFO_FIELD, CONTROLLER_NODE_INFO_FIELD, INSTANCE_TYPE_FIELD, NODE_ARN_FIELD, NODE_TYPE_FIELD, ZOOKEEPER_NODE_INFO_FIELD)); private static final long serialVersionUID = 1L; private final String addedToClusterTime; private final BrokerNodeInfo brokerNodeInfo; private final ControllerNodeInfo controllerNodeInfo; private final String instanceType; private final String nodeARN; private final String nodeType; private final ZookeeperNodeInfo zookeeperNodeInfo; private NodeInfo(BuilderImpl builder) { this.addedToClusterTime = builder.addedToClusterTime; this.brokerNodeInfo = builder.brokerNodeInfo; this.controllerNodeInfo = builder.controllerNodeInfo; this.instanceType = builder.instanceType; this.nodeARN = builder.nodeARN; this.nodeType = builder.nodeType; this.zookeeperNodeInfo = builder.zookeeperNodeInfo; } /** * *

* The start time. *

* * @return

* The start time. *

*/ public final String addedToClusterTime() { return addedToClusterTime; } /** * *

* The broker node info. *

* * @return

* The broker node info. *

*/ public final BrokerNodeInfo brokerNodeInfo() { return brokerNodeInfo; } /** * *

* The ControllerNodeInfo. *

* * @return

* The ControllerNodeInfo. *

*/ public final ControllerNodeInfo controllerNodeInfo() { return controllerNodeInfo; } /** * *

* The instance type. *

* * @return

* The instance type. *

*/ public final String instanceType() { return instanceType; } /** * *

* The Amazon Resource Name (ARN) of the node. *

* * @return

* The Amazon Resource Name (ARN) of the node. *

*/ public final String nodeARN() { return nodeARN; } /** * *

* The node type. *

* *

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

* * @return

* The node type. *

* @see NodeType */ public final NodeType nodeType() { return NodeType.fromValue(nodeType); } /** * *

* The node type. *

* *

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

* * @return

* The node type. *

* @see NodeType */ public final String nodeTypeAsString() { return nodeType; } /** * *

* The ZookeeperNodeInfo. *

* * @return

* The ZookeeperNodeInfo. *

*/ public final ZookeeperNodeInfo zookeeperNodeInfo() { return zookeeperNodeInfo; } @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(addedToClusterTime()); hashCode = 31 * hashCode + Objects.hashCode(brokerNodeInfo()); hashCode = 31 * hashCode + Objects.hashCode(controllerNodeInfo()); hashCode = 31 * hashCode + Objects.hashCode(instanceType()); hashCode = 31 * hashCode + Objects.hashCode(nodeARN()); hashCode = 31 * hashCode + Objects.hashCode(nodeTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(zookeeperNodeInfo()); 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 NodeInfo)) { return false; } NodeInfo other = (NodeInfo) obj; return Objects.equals(addedToClusterTime(), other.addedToClusterTime()) && Objects.equals(brokerNodeInfo(), other.brokerNodeInfo()) && Objects.equals(controllerNodeInfo(), other.controllerNodeInfo()) && Objects.equals(instanceType(), other.instanceType()) && Objects.equals(nodeARN(), other.nodeARN()) && Objects.equals(nodeTypeAsString(), other.nodeTypeAsString()) && Objects.equals(zookeeperNodeInfo(), other.zookeeperNodeInfo()); } /** * 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("NodeInfo").add("AddedToClusterTime", addedToClusterTime()) .add("BrokerNodeInfo", brokerNodeInfo()).add("ControllerNodeInfo", controllerNodeInfo()) .add("InstanceType", instanceType()).add("NodeARN", nodeARN()).add("NodeType", nodeTypeAsString()) .add("ZookeeperNodeInfo", zookeeperNodeInfo()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "AddedToClusterTime": return Optional.ofNullable(clazz.cast(addedToClusterTime())); case "BrokerNodeInfo": return Optional.ofNullable(clazz.cast(brokerNodeInfo())); case "ControllerNodeInfo": return Optional.ofNullable(clazz.cast(controllerNodeInfo())); case "InstanceType": return Optional.ofNullable(clazz.cast(instanceType())); case "NodeARN": return Optional.ofNullable(clazz.cast(nodeARN())); case "NodeType": return Optional.ofNullable(clazz.cast(nodeTypeAsString())); case "ZookeeperNodeInfo": return Optional.ofNullable(clazz.cast(zookeeperNodeInfo())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((NodeInfo) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** * *

* The start time. *

* * @param addedToClusterTime *

* The start time. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder addedToClusterTime(String addedToClusterTime); /** * *

* The broker node info. *

* * @param brokerNodeInfo *

* The broker node info. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder brokerNodeInfo(BrokerNodeInfo brokerNodeInfo); /** * *

* The broker node info. *

* * This is a convenience method that creates an instance of the {@link BrokerNodeInfo.Builder} avoiding the need * to create one manually via {@link BrokerNodeInfo#builder()}. * *

* When the {@link Consumer} completes, {@link BrokerNodeInfo.Builder#build()} is called immediately and its * result is passed to {@link #brokerNodeInfo(BrokerNodeInfo)}. * * @param brokerNodeInfo * a consumer that will call methods on {@link BrokerNodeInfo.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #brokerNodeInfo(BrokerNodeInfo) */ default Builder brokerNodeInfo(Consumer brokerNodeInfo) { return brokerNodeInfo(BrokerNodeInfo.builder().applyMutation(brokerNodeInfo).build()); } /** * *

* The ControllerNodeInfo. *

* * @param controllerNodeInfo *

* The ControllerNodeInfo. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder controllerNodeInfo(ControllerNodeInfo controllerNodeInfo); /** * *

* The ControllerNodeInfo. *

* * This is a convenience method that creates an instance of the {@link ControllerNodeInfo.Builder} avoiding the * need to create one manually via {@link ControllerNodeInfo#builder()}. * *

* When the {@link Consumer} completes, {@link ControllerNodeInfo.Builder#build()} is called immediately and its * result is passed to {@link #controllerNodeInfo(ControllerNodeInfo)}. * * @param controllerNodeInfo * a consumer that will call methods on {@link ControllerNodeInfo.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #controllerNodeInfo(ControllerNodeInfo) */ default Builder controllerNodeInfo(Consumer controllerNodeInfo) { return controllerNodeInfo(ControllerNodeInfo.builder().applyMutation(controllerNodeInfo).build()); } /** * *

* The instance type. *

* * @param instanceType *

* The instance type. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder instanceType(String instanceType); /** * *

* The Amazon Resource Name (ARN) of the node. *

* * @param nodeARN *

* The Amazon Resource Name (ARN) of the node. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder nodeARN(String nodeARN); /** * *

* The node type. *

* * @param nodeType *

* The node type. *

* @see NodeType * @return Returns a reference to this object so that method calls can be chained together. * @see NodeType */ Builder nodeType(String nodeType); /** * *

* The node type. *

* * @param nodeType *

* The node type. *

* @see NodeType * @return Returns a reference to this object so that method calls can be chained together. * @see NodeType */ Builder nodeType(NodeType nodeType); /** * *

* The ZookeeperNodeInfo. *

* * @param zookeeperNodeInfo *

* The ZookeeperNodeInfo. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder zookeeperNodeInfo(ZookeeperNodeInfo zookeeperNodeInfo); /** * *

* The ZookeeperNodeInfo. *

* * This is a convenience method that creates an instance of the {@link ZookeeperNodeInfo.Builder} avoiding the * need to create one manually via {@link ZookeeperNodeInfo#builder()}. * *

* When the {@link Consumer} completes, {@link ZookeeperNodeInfo.Builder#build()} is called immediately and its * result is passed to {@link #zookeeperNodeInfo(ZookeeperNodeInfo)}. * * @param zookeeperNodeInfo * a consumer that will call methods on {@link ZookeeperNodeInfo.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #zookeeperNodeInfo(ZookeeperNodeInfo) */ default Builder zookeeperNodeInfo(Consumer zookeeperNodeInfo) { return zookeeperNodeInfo(ZookeeperNodeInfo.builder().applyMutation(zookeeperNodeInfo).build()); } } static final class BuilderImpl implements Builder { private String addedToClusterTime; private BrokerNodeInfo brokerNodeInfo; private ControllerNodeInfo controllerNodeInfo; private String instanceType; private String nodeARN; private String nodeType; private ZookeeperNodeInfo zookeeperNodeInfo; private BuilderImpl() { } private BuilderImpl(NodeInfo model) { addedToClusterTime(model.addedToClusterTime); brokerNodeInfo(model.brokerNodeInfo); controllerNodeInfo(model.controllerNodeInfo); instanceType(model.instanceType); nodeARN(model.nodeARN); nodeType(model.nodeType); zookeeperNodeInfo(model.zookeeperNodeInfo); } public final String getAddedToClusterTime() { return addedToClusterTime; } public final void setAddedToClusterTime(String addedToClusterTime) { this.addedToClusterTime = addedToClusterTime; } @Override public final Builder addedToClusterTime(String addedToClusterTime) { this.addedToClusterTime = addedToClusterTime; return this; } public final BrokerNodeInfo.Builder getBrokerNodeInfo() { return brokerNodeInfo != null ? brokerNodeInfo.toBuilder() : null; } public final void setBrokerNodeInfo(BrokerNodeInfo.BuilderImpl brokerNodeInfo) { this.brokerNodeInfo = brokerNodeInfo != null ? brokerNodeInfo.build() : null; } @Override public final Builder brokerNodeInfo(BrokerNodeInfo brokerNodeInfo) { this.brokerNodeInfo = brokerNodeInfo; return this; } public final ControllerNodeInfo.Builder getControllerNodeInfo() { return controllerNodeInfo != null ? controllerNodeInfo.toBuilder() : null; } public final void setControllerNodeInfo(ControllerNodeInfo.BuilderImpl controllerNodeInfo) { this.controllerNodeInfo = controllerNodeInfo != null ? controllerNodeInfo.build() : null; } @Override public final Builder controllerNodeInfo(ControllerNodeInfo controllerNodeInfo) { this.controllerNodeInfo = controllerNodeInfo; return this; } public final String getInstanceType() { return instanceType; } public final void setInstanceType(String instanceType) { this.instanceType = instanceType; } @Override public final Builder instanceType(String instanceType) { this.instanceType = instanceType; return this; } public final String getNodeARN() { return nodeARN; } public final void setNodeARN(String nodeARN) { this.nodeARN = nodeARN; } @Override public final Builder nodeARN(String nodeARN) { this.nodeARN = nodeARN; return this; } public final String getNodeType() { return nodeType; } public final void setNodeType(String nodeType) { this.nodeType = nodeType; } @Override public final Builder nodeType(String nodeType) { this.nodeType = nodeType; return this; } @Override public final Builder nodeType(NodeType nodeType) { this.nodeType(nodeType == null ? null : nodeType.toString()); return this; } public final ZookeeperNodeInfo.Builder getZookeeperNodeInfo() { return zookeeperNodeInfo != null ? zookeeperNodeInfo.toBuilder() : null; } public final void setZookeeperNodeInfo(ZookeeperNodeInfo.BuilderImpl zookeeperNodeInfo) { this.zookeeperNodeInfo = zookeeperNodeInfo != null ? zookeeperNodeInfo.build() : null; } @Override public final Builder zookeeperNodeInfo(ZookeeperNodeInfo zookeeperNodeInfo) { this.zookeeperNodeInfo = zookeeperNodeInfo; return this; } @Override public NodeInfo build() { return new NodeInfo(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy