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

software.amazon.awssdk.services.resourcegroups.model.GroupIdentifier Maven / Gradle / Ivy

Go to download

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

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

import java.io.Serializable;
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;

/**
 * 

* The unique identifiers for a resource group. *

*/ @Generated("software.amazon.awssdk:codegen") public final class GroupIdentifier implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField GROUP_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("GroupName").getter(getter(GroupIdentifier::groupName)).setter(setter(Builder::groupName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GroupName").build()).build(); private static final SdkField GROUP_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("GroupArn").getter(getter(GroupIdentifier::groupArn)).setter(setter(Builder::groupArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GroupArn").build()).build(); private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("Description").getter(getter(GroupIdentifier::description)).setter(setter(Builder::description)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build(); private static final SdkField CRITICALITY_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("Criticality").getter(getter(GroupIdentifier::criticality)).setter(setter(Builder::criticality)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Criticality").build()).build(); private static final SdkField OWNER_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Owner") .getter(getter(GroupIdentifier::owner)).setter(setter(Builder::owner)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Owner").build()).build(); private static final SdkField DISPLAY_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("DisplayName").getter(getter(GroupIdentifier::displayName)).setter(setter(Builder::displayName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DisplayName").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(GROUP_NAME_FIELD, GROUP_ARN_FIELD, DESCRIPTION_FIELD, CRITICALITY_FIELD, OWNER_FIELD, DISPLAY_NAME_FIELD)); private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer(); private static final long serialVersionUID = 1L; private final String groupName; private final String groupArn; private final String description; private final Integer criticality; private final String owner; private final String displayName; private GroupIdentifier(BuilderImpl builder) { this.groupName = builder.groupName; this.groupArn = builder.groupArn; this.description = builder.description; this.criticality = builder.criticality; this.owner = builder.owner; this.displayName = builder.displayName; } /** *

* The name of the resource group. *

* * @return The name of the resource group. */ public final String groupName() { return groupName; } /** *

* The Amazon resource name (ARN) of the resource group. *

* * @return The Amazon resource name (ARN) of the resource group. */ public final String groupArn() { return groupArn; } /** *

* The description of the application group. *

* * @return The description of the application group. */ public final String description() { return description; } /** *

* The critical rank of the application group on a scale of 1 to 10, with a rank of 1 being the most critical, and a * rank of 10 being least critical. *

* * @return The critical rank of the application group on a scale of 1 to 10, with a rank of 1 being the most * critical, and a rank of 10 being least critical. */ public final Integer criticality() { return criticality; } /** *

* A name, email address or other identifier for the person or group who is considered as the owner of this group * within your organization. *

* * @return A name, email address or other identifier for the person or group who is considered as the owner of this * group within your organization. */ public final String owner() { return owner; } /** *

* The name of the application group, which you can change at any time. *

* * @return The name of the application group, which you can change at any time. */ public final String displayName() { return displayName; } @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(groupName()); hashCode = 31 * hashCode + Objects.hashCode(groupArn()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(criticality()); hashCode = 31 * hashCode + Objects.hashCode(owner()); hashCode = 31 * hashCode + Objects.hashCode(displayName()); 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 GroupIdentifier)) { return false; } GroupIdentifier other = (GroupIdentifier) obj; return Objects.equals(groupName(), other.groupName()) && Objects.equals(groupArn(), other.groupArn()) && Objects.equals(description(), other.description()) && Objects.equals(criticality(), other.criticality()) && Objects.equals(owner(), other.owner()) && Objects.equals(displayName(), other.displayName()); } /** * 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("GroupIdentifier").add("GroupName", groupName()).add("GroupArn", groupArn()) .add("Description", description()).add("Criticality", criticality()).add("Owner", owner()) .add("DisplayName", displayName()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "GroupName": return Optional.ofNullable(clazz.cast(groupName())); case "GroupArn": return Optional.ofNullable(clazz.cast(groupArn())); case "Description": return Optional.ofNullable(clazz.cast(description())); case "Criticality": return Optional.ofNullable(clazz.cast(criticality())); case "Owner": return Optional.ofNullable(clazz.cast(owner())); case "DisplayName": return Optional.ofNullable(clazz.cast(displayName())); 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("GroupName", GROUP_NAME_FIELD); map.put("GroupArn", GROUP_ARN_FIELD); map.put("Description", DESCRIPTION_FIELD); map.put("Criticality", CRITICALITY_FIELD); map.put("Owner", OWNER_FIELD); map.put("DisplayName", DISPLAY_NAME_FIELD); return Collections.unmodifiableMap(map); } private static Function getter(Function g) { return obj -> g.apply((GroupIdentifier) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The name of the resource group. *

* * @param groupName * The name of the resource group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder groupName(String groupName); /** *

* The Amazon resource name (ARN) of the resource group. *

* * @param groupArn * The Amazon resource name (ARN) of the resource group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder groupArn(String groupArn); /** *

* The description of the application group. *

* * @param description * The description of the application group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* The critical rank of the application group on a scale of 1 to 10, with a rank of 1 being the most critical, * and a rank of 10 being least critical. *

* * @param criticality * The critical rank of the application group on a scale of 1 to 10, with a rank of 1 being the most * critical, and a rank of 10 being least critical. * @return Returns a reference to this object so that method calls can be chained together. */ Builder criticality(Integer criticality); /** *

* A name, email address or other identifier for the person or group who is considered as the owner of this * group within your organization. *

* * @param owner * A name, email address or other identifier for the person or group who is considered as the owner of * this group within your organization. * @return Returns a reference to this object so that method calls can be chained together. */ Builder owner(String owner); /** *

* The name of the application group, which you can change at any time. *

* * @param displayName * The name of the application group, which you can change at any time. * @return Returns a reference to this object so that method calls can be chained together. */ Builder displayName(String displayName); } static final class BuilderImpl implements Builder { private String groupName; private String groupArn; private String description; private Integer criticality; private String owner; private String displayName; private BuilderImpl() { } private BuilderImpl(GroupIdentifier model) { groupName(model.groupName); groupArn(model.groupArn); description(model.description); criticality(model.criticality); owner(model.owner); displayName(model.displayName); } public final String getGroupName() { return groupName; } public final void setGroupName(String groupName) { this.groupName = groupName; } @Override public final Builder groupName(String groupName) { this.groupName = groupName; return this; } public final String getGroupArn() { return groupArn; } public final void setGroupArn(String groupArn) { this.groupArn = groupArn; } @Override public final Builder groupArn(String groupArn) { this.groupArn = groupArn; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } public final Integer getCriticality() { return criticality; } public final void setCriticality(Integer criticality) { this.criticality = criticality; } @Override public final Builder criticality(Integer criticality) { this.criticality = criticality; return this; } public final String getOwner() { return owner; } public final void setOwner(String owner) { this.owner = owner; } @Override public final Builder owner(String owner) { this.owner = owner; return this; } public final String getDisplayName() { return displayName; } public final void setDisplayName(String displayName) { this.displayName = displayName; } @Override public final Builder displayName(String displayName) { this.displayName = displayName; return this; } @Override public GroupIdentifier build() { return new GroupIdentifier(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy