
software.amazon.awssdk.services.sms.model.GetReplicationJobsResponse 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.sms.model;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
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 GetReplicationJobsResponse extends SmsResponse implements
ToCopyableBuilder {
private final List replicationJobList;
private final String nextToken;
private GetReplicationJobsResponse(BuilderImpl builder) {
super(builder);
this.replicationJobList = builder.replicationJobList;
this.nextToken = builder.nextToken;
}
/**
* Returns the value of the ReplicationJobList property for this object.
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return The value of the ReplicationJobList property for this object.
*/
public List replicationJobList() {
return replicationJobList;
}
/**
* Returns the value of the NextToken property for this object.
*
* @return The value of the NextToken property for this object.
*/
public String nextToken() {
return nextToken;
}
@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(replicationJobList());
hashCode = 31 * hashCode + Objects.hashCode(nextToken());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof GetReplicationJobsResponse)) {
return false;
}
GetReplicationJobsResponse other = (GetReplicationJobsResponse) obj;
return Objects.equals(replicationJobList(), other.replicationJobList()) && Objects.equals(nextToken(), other.nextToken());
}
@Override
public String toString() {
return ToString.builder("GetReplicationJobsResponse").add("ReplicationJobList", replicationJobList())
.add("NextToken", nextToken()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "replicationJobList":
return Optional.ofNullable(clazz.cast(replicationJobList()));
case "nextToken":
return Optional.ofNullable(clazz.cast(nextToken()));
default:
return Optional.empty();
}
}
public interface Builder extends SmsResponse.Builder, CopyableBuilder {
/**
* Sets the value of the ReplicationJobList property for this object.
*
* @param replicationJobList
* The new value for the ReplicationJobList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder replicationJobList(Collection replicationJobList);
/**
* Sets the value of the ReplicationJobList property for this object.
*
* @param replicationJobList
* The new value for the ReplicationJobList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder replicationJobList(ReplicationJob... replicationJobList);
/**
* Sets the value of the ReplicationJobList property for this object.
*
* This is a convenience that creates an instance of the {@link List.Builder} avoiding the need
* to create one manually via {@link List#builder()}.
*
* When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and
* its result is passed to {@link #replicationJobList(List)}.
*
* @param replicationJobList
* a consumer that will call methods on {@link List.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #replicationJobList(List)
*/
Builder replicationJobList(Consumer... replicationJobList);
/**
* Sets the value of the NextToken property for this object.
*
* @param nextToken
* The new value for the NextToken property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder nextToken(String nextToken);
}
static final class BuilderImpl extends SmsResponse.BuilderImpl implements Builder {
private List replicationJobList = DefaultSdkAutoConstructList.getInstance();
private String nextToken;
private BuilderImpl() {
}
private BuilderImpl(GetReplicationJobsResponse model) {
super(model);
replicationJobList(model.replicationJobList);
nextToken(model.nextToken);
}
public final Collection getReplicationJobList() {
return replicationJobList != null ? replicationJobList.stream().map(ReplicationJob::toBuilder)
.collect(Collectors.toList()) : null;
}
@Override
public final Builder replicationJobList(Collection replicationJobList) {
this.replicationJobList = ReplicationJobListCopier.copy(replicationJobList);
return this;
}
@Override
@SafeVarargs
public final Builder replicationJobList(ReplicationJob... replicationJobList) {
replicationJobList(Arrays.asList(replicationJobList));
return this;
}
@Override
@SafeVarargs
public final Builder replicationJobList(Consumer... replicationJobList) {
replicationJobList(Stream.of(replicationJobList).map(c -> ReplicationJob.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final void setReplicationJobList(Collection replicationJobList) {
this.replicationJobList = ReplicationJobListCopier.copyFromBuilder(replicationJobList);
}
public final String getNextToken() {
return nextToken;
}
@Override
public final Builder nextToken(String nextToken) {
this.nextToken = nextToken;
return this;
}
public final void setNextToken(String nextToken) {
this.nextToken = nextToken;
}
@Override
public GetReplicationJobsResponse build() {
return new GetReplicationJobsResponse(this);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy