
software.amazon.awssdk.services.resourcegroups.model.GetGroupQueryResponse Maven / Gradle / Ivy
/*
* Copyright 2013-2018 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.util.Objects;
import java.util.Optional;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class GetGroupQueryResponse extends ResourceGroupsResponse implements
ToCopyableBuilder {
private final GroupQuery groupQuery;
private GetGroupQueryResponse(BuilderImpl builder) {
super(builder);
this.groupQuery = builder.groupQuery;
}
/**
*
* The resource query associated with the specified group.
*
*
* @return The resource query associated with the specified group.
*/
public GroupQuery groupQuery() {
return groupQuery;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(groupQuery());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof GetGroupQueryResponse)) {
return false;
}
GetGroupQueryResponse other = (GetGroupQueryResponse) obj;
return Objects.equals(groupQuery(), other.groupQuery());
}
@Override
public String toString() {
return ToString.builder("GetGroupQueryResponse").add("GroupQuery", groupQuery()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "GroupQuery":
return Optional.ofNullable(clazz.cast(groupQuery()));
default:
return Optional.empty();
}
}
public interface Builder extends ResourceGroupsResponse.Builder, CopyableBuilder {
/**
*
* The resource query associated with the specified group.
*
*
* @param groupQuery
* The resource query associated with the specified group.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder groupQuery(GroupQuery groupQuery);
/**
*
* The resource query associated with the specified group.
*
* This is a convenience that creates an instance of the {@link GroupQuery.Builder} avoiding the need to create
* one manually via {@link GroupQuery#builder()}.
*
* When the {@link Consumer} completes, {@link GroupQuery.Builder#build()} is called immediately and its result
* is passed to {@link #groupQuery(GroupQuery)}.
*
* @param groupQuery
* a consumer that will call methods on {@link GroupQuery.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #groupQuery(GroupQuery)
*/
default Builder groupQuery(Consumer groupQuery) {
return groupQuery(GroupQuery.builder().applyMutation(groupQuery).build());
}
}
static final class BuilderImpl extends ResourceGroupsResponse.BuilderImpl implements Builder {
private GroupQuery groupQuery;
private BuilderImpl() {
}
private BuilderImpl(GetGroupQueryResponse model) {
super(model);
groupQuery(model.groupQuery);
}
public final GroupQuery.Builder getGroupQuery() {
return groupQuery != null ? groupQuery.toBuilder() : null;
}
@Override
public final Builder groupQuery(GroupQuery groupQuery) {
this.groupQuery = groupQuery;
return this;
}
public final void setGroupQuery(GroupQuery.BuilderImpl groupQuery) {
this.groupQuery = groupQuery != null ? groupQuery.build() : null;
}
@Override
public GetGroupQueryResponse build() {
return new GetGroupQueryResponse(this);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy