software.amazon.awssdk.services.resourcegroups.model.GroupIdentifier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of resourcegroups Show documentation
Show all versions of resourcegroups Show documentation
The AWS Java SDK for AWS Resource Groups module holds the client classes that are used for
communicating
with AWS Resource Groups 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.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 extends Builder> 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
© 2015 - 2025 Weber Informatics LLC | Privacy Policy