software.amazon.awssdk.services.iot.model.TopicRuleListItem Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of iot Show documentation
Show all versions of iot Show documentation
The AWS Java SDK for AWS Iot Service module holds the client classes that are used for communicating
with AWS IoT Service
/*
* 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.iot.model;
import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Describes a rule.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class TopicRuleListItem implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField RULE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ruleArn").getter(getter(TopicRuleListItem::ruleArn)).setter(setter(Builder::ruleArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ruleArn").build()).build();
private static final SdkField RULE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ruleName").getter(getter(TopicRuleListItem::ruleName)).setter(setter(Builder::ruleName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ruleName").build()).build();
private static final SdkField TOPIC_PATTERN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("topicPattern").getter(getter(TopicRuleListItem::topicPattern)).setter(setter(Builder::topicPattern))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("topicPattern").build()).build();
private static final SdkField CREATED_AT_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("createdAt").getter(getter(TopicRuleListItem::createdAt)).setter(setter(Builder::createdAt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("createdAt").build()).build();
private static final SdkField RULE_DISABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("ruleDisabled").getter(getter(TopicRuleListItem::ruleDisabled)).setter(setter(Builder::ruleDisabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ruleDisabled").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(RULE_ARN_FIELD,
RULE_NAME_FIELD, TOPIC_PATTERN_FIELD, CREATED_AT_FIELD, RULE_DISABLED_FIELD));
private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer();
private static final long serialVersionUID = 1L;
private final String ruleArn;
private final String ruleName;
private final String topicPattern;
private final Instant createdAt;
private final Boolean ruleDisabled;
private TopicRuleListItem(BuilderImpl builder) {
this.ruleArn = builder.ruleArn;
this.ruleName = builder.ruleName;
this.topicPattern = builder.topicPattern;
this.createdAt = builder.createdAt;
this.ruleDisabled = builder.ruleDisabled;
}
/**
*
* The rule ARN.
*
*
* @return The rule ARN.
*/
public final String ruleArn() {
return ruleArn;
}
/**
*
* The name of the rule.
*
*
* @return The name of the rule.
*/
public final String ruleName() {
return ruleName;
}
/**
*
* The pattern for the topic names that apply.
*
*
* @return The pattern for the topic names that apply.
*/
public final String topicPattern() {
return topicPattern;
}
/**
*
* The date and time the rule was created.
*
*
* @return The date and time the rule was created.
*/
public final Instant createdAt() {
return createdAt;
}
/**
*
* Specifies whether the rule is disabled.
*
*
* @return Specifies whether the rule is disabled.
*/
public final Boolean ruleDisabled() {
return ruleDisabled;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(ruleArn());
hashCode = 31 * hashCode + Objects.hashCode(ruleName());
hashCode = 31 * hashCode + Objects.hashCode(topicPattern());
hashCode = 31 * hashCode + Objects.hashCode(createdAt());
hashCode = 31 * hashCode + Objects.hashCode(ruleDisabled());
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 TopicRuleListItem)) {
return false;
}
TopicRuleListItem other = (TopicRuleListItem) obj;
return Objects.equals(ruleArn(), other.ruleArn()) && Objects.equals(ruleName(), other.ruleName())
&& Objects.equals(topicPattern(), other.topicPattern()) && Objects.equals(createdAt(), other.createdAt())
&& Objects.equals(ruleDisabled(), other.ruleDisabled());
}
/**
* 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("TopicRuleListItem").add("RuleArn", ruleArn()).add("RuleName", ruleName())
.add("TopicPattern", topicPattern()).add("CreatedAt", createdAt()).add("RuleDisabled", ruleDisabled()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ruleArn":
return Optional.ofNullable(clazz.cast(ruleArn()));
case "ruleName":
return Optional.ofNullable(clazz.cast(ruleName()));
case "topicPattern":
return Optional.ofNullable(clazz.cast(topicPattern()));
case "createdAt":
return Optional.ofNullable(clazz.cast(createdAt()));
case "ruleDisabled":
return Optional.ofNullable(clazz.cast(ruleDisabled()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Map> memberNameToFieldInitializer() {
Map> map = new HashMap<>();
map.put("ruleArn", RULE_ARN_FIELD);
map.put("ruleName", RULE_NAME_FIELD);
map.put("topicPattern", TOPIC_PATTERN_FIELD);
map.put("createdAt", CREATED_AT_FIELD);
map.put("ruleDisabled", RULE_DISABLED_FIELD);
return Collections.unmodifiableMap(map);
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy