software.amazon.awssdk.services.kinesisanalytics.model.ApplicationUpdate Maven / Gradle / Ivy
Show all versions of kinesis Show documentation
/*
* 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.kinesisanalytics.model;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
import javax.annotation.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.core.protocol.ProtocolMarshaller;
import software.amazon.awssdk.core.protocol.StructuredPojo;
import software.amazon.awssdk.services.kinesisanalytics.transform.ApplicationUpdateMarshaller;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Describes updates to apply to an existing Amazon Kinesis Analytics application.
*
*/
@Generated("software.amazon.awssdk:codegen")
public class ApplicationUpdate implements StructuredPojo, ToCopyableBuilder {
private final List inputUpdates;
private final String applicationCodeUpdate;
private final List outputUpdates;
private final List referenceDataSourceUpdates;
private final List cloudWatchLoggingOptionUpdates;
private ApplicationUpdate(BuilderImpl builder) {
this.inputUpdates = builder.inputUpdates;
this.applicationCodeUpdate = builder.applicationCodeUpdate;
this.outputUpdates = builder.outputUpdates;
this.referenceDataSourceUpdates = builder.referenceDataSourceUpdates;
this.cloudWatchLoggingOptionUpdates = builder.cloudWatchLoggingOptionUpdates;
}
/**
*
* Describes application input configuration updates.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return Describes application input configuration updates.
*/
public List inputUpdates() {
return inputUpdates;
}
/**
*
* Describes application code updates.
*
*
* @return Describes application code updates.
*/
public String applicationCodeUpdate() {
return applicationCodeUpdate;
}
/**
*
* Describes application output configuration updates.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return Describes application output configuration updates.
*/
public List outputUpdates() {
return outputUpdates;
}
/**
*
* Describes application reference data source updates.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return Describes application reference data source updates.
*/
public List referenceDataSourceUpdates() {
return referenceDataSourceUpdates;
}
/**
*
* Describes application CloudWatch logging option updates.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return Describes application CloudWatch logging option updates.
*/
public List cloudWatchLoggingOptionUpdates() {
return cloudWatchLoggingOptionUpdates;
}
@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(inputUpdates());
hashCode = 31 * hashCode + Objects.hashCode(applicationCodeUpdate());
hashCode = 31 * hashCode + Objects.hashCode(outputUpdates());
hashCode = 31 * hashCode + Objects.hashCode(referenceDataSourceUpdates());
hashCode = 31 * hashCode + Objects.hashCode(cloudWatchLoggingOptionUpdates());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ApplicationUpdate)) {
return false;
}
ApplicationUpdate other = (ApplicationUpdate) obj;
return Objects.equals(inputUpdates(), other.inputUpdates())
&& Objects.equals(applicationCodeUpdate(), other.applicationCodeUpdate())
&& Objects.equals(outputUpdates(), other.outputUpdates())
&& Objects.equals(referenceDataSourceUpdates(), other.referenceDataSourceUpdates())
&& Objects.equals(cloudWatchLoggingOptionUpdates(), other.cloudWatchLoggingOptionUpdates());
}
@Override
public String toString() {
return ToString.builder("ApplicationUpdate").add("InputUpdates", inputUpdates())
.add("ApplicationCodeUpdate", applicationCodeUpdate()).add("OutputUpdates", outputUpdates())
.add("ReferenceDataSourceUpdates", referenceDataSourceUpdates())
.add("CloudWatchLoggingOptionUpdates", cloudWatchLoggingOptionUpdates()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "InputUpdates":
return Optional.of(clazz.cast(inputUpdates()));
case "ApplicationCodeUpdate":
return Optional.of(clazz.cast(applicationCodeUpdate()));
case "OutputUpdates":
return Optional.of(clazz.cast(outputUpdates()));
case "ReferenceDataSourceUpdates":
return Optional.of(clazz.cast(referenceDataSourceUpdates()));
case "CloudWatchLoggingOptionUpdates":
return Optional.of(clazz.cast(cloudWatchLoggingOptionUpdates()));
default:
return Optional.empty();
}
}
@SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
ApplicationUpdateMarshaller.getInstance().marshall(this, protocolMarshaller);
}
public interface Builder extends CopyableBuilder {
/**
*
* Describes application input configuration updates.
*
*
* @param inputUpdates
* Describes application input configuration updates.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder inputUpdates(Collection inputUpdates);
/**
*
* Describes application input configuration updates.
*
*
* @param inputUpdates
* Describes application input configuration updates.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder inputUpdates(InputUpdate... inputUpdates);
/**
*
* Describes application code updates.
*
*
* @param applicationCodeUpdate
* Describes application code updates.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder applicationCodeUpdate(String applicationCodeUpdate);
/**
*
* Describes application output configuration updates.
*
*
* @param outputUpdates
* Describes application output configuration updates.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder outputUpdates(Collection outputUpdates);
/**
*
* Describes application output configuration updates.
*
*
* @param outputUpdates
* Describes application output configuration updates.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder outputUpdates(OutputUpdate... outputUpdates);
/**
*
* Describes application reference data source updates.
*
*
* @param referenceDataSourceUpdates
* Describes application reference data source updates.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder referenceDataSourceUpdates(Collection referenceDataSourceUpdates);
/**
*
* Describes application reference data source updates.
*
*
* @param referenceDataSourceUpdates
* Describes application reference data source updates.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder referenceDataSourceUpdates(ReferenceDataSourceUpdate... referenceDataSourceUpdates);
/**
*
* Describes application CloudWatch logging option updates.
*
*
* @param cloudWatchLoggingOptionUpdates
* Describes application CloudWatch logging option updates.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder cloudWatchLoggingOptionUpdates(Collection cloudWatchLoggingOptionUpdates);
/**
*
* Describes application CloudWatch logging option updates.
*
*
* @param cloudWatchLoggingOptionUpdates
* Describes application CloudWatch logging option updates.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder cloudWatchLoggingOptionUpdates(CloudWatchLoggingOptionUpdate... cloudWatchLoggingOptionUpdates);
}
static final class BuilderImpl implements Builder {
private List inputUpdates;
private String applicationCodeUpdate;
private List outputUpdates;
private List referenceDataSourceUpdates;
private List cloudWatchLoggingOptionUpdates;
private BuilderImpl() {
}
private BuilderImpl(ApplicationUpdate model) {
inputUpdates(model.inputUpdates);
applicationCodeUpdate(model.applicationCodeUpdate);
outputUpdates(model.outputUpdates);
referenceDataSourceUpdates(model.referenceDataSourceUpdates);
cloudWatchLoggingOptionUpdates(model.cloudWatchLoggingOptionUpdates);
}
public final Collection getInputUpdates() {
return inputUpdates != null ? inputUpdates.stream().map(InputUpdate::toBuilder).collect(Collectors.toList()) : null;
}
@Override
public final Builder inputUpdates(Collection inputUpdates) {
this.inputUpdates = InputUpdatesCopier.copy(inputUpdates);
return this;
}
@Override
@SafeVarargs
public final Builder inputUpdates(InputUpdate... inputUpdates) {
inputUpdates(Arrays.asList(inputUpdates));
return this;
}
public final void setInputUpdates(Collection inputUpdates) {
this.inputUpdates = InputUpdatesCopier.copyFromBuilder(inputUpdates);
}
public final String getApplicationCodeUpdate() {
return applicationCodeUpdate;
}
@Override
public final Builder applicationCodeUpdate(String applicationCodeUpdate) {
this.applicationCodeUpdate = applicationCodeUpdate;
return this;
}
public final void setApplicationCodeUpdate(String applicationCodeUpdate) {
this.applicationCodeUpdate = applicationCodeUpdate;
}
public final Collection getOutputUpdates() {
return outputUpdates != null ? outputUpdates.stream().map(OutputUpdate::toBuilder).collect(Collectors.toList())
: null;
}
@Override
public final Builder outputUpdates(Collection outputUpdates) {
this.outputUpdates = OutputUpdatesCopier.copy(outputUpdates);
return this;
}
@Override
@SafeVarargs
public final Builder outputUpdates(OutputUpdate... outputUpdates) {
outputUpdates(Arrays.asList(outputUpdates));
return this;
}
public final void setOutputUpdates(Collection outputUpdates) {
this.outputUpdates = OutputUpdatesCopier.copyFromBuilder(outputUpdates);
}
public final Collection getReferenceDataSourceUpdates() {
return referenceDataSourceUpdates != null ? referenceDataSourceUpdates.stream()
.map(ReferenceDataSourceUpdate::toBuilder).collect(Collectors.toList()) : null;
}
@Override
public final Builder referenceDataSourceUpdates(Collection referenceDataSourceUpdates) {
this.referenceDataSourceUpdates = ReferenceDataSourceUpdatesCopier.copy(referenceDataSourceUpdates);
return this;
}
@Override
@SafeVarargs
public final Builder referenceDataSourceUpdates(ReferenceDataSourceUpdate... referenceDataSourceUpdates) {
referenceDataSourceUpdates(Arrays.asList(referenceDataSourceUpdates));
return this;
}
public final void setReferenceDataSourceUpdates(
Collection referenceDataSourceUpdates) {
this.referenceDataSourceUpdates = ReferenceDataSourceUpdatesCopier.copyFromBuilder(referenceDataSourceUpdates);
}
public final Collection getCloudWatchLoggingOptionUpdates() {
return cloudWatchLoggingOptionUpdates != null ? cloudWatchLoggingOptionUpdates.stream()
.map(CloudWatchLoggingOptionUpdate::toBuilder).collect(Collectors.toList()) : null;
}
@Override
public final Builder cloudWatchLoggingOptionUpdates(
Collection cloudWatchLoggingOptionUpdates) {
this.cloudWatchLoggingOptionUpdates = CloudWatchLoggingOptionUpdatesCopier.copy(cloudWatchLoggingOptionUpdates);
return this;
}
@Override
@SafeVarargs
public final Builder cloudWatchLoggingOptionUpdates(CloudWatchLoggingOptionUpdate... cloudWatchLoggingOptionUpdates) {
cloudWatchLoggingOptionUpdates(Arrays.asList(cloudWatchLoggingOptionUpdates));
return this;
}
public final void setCloudWatchLoggingOptionUpdates(
Collection cloudWatchLoggingOptionUpdates) {
this.cloudWatchLoggingOptionUpdates = CloudWatchLoggingOptionUpdatesCopier
.copyFromBuilder(cloudWatchLoggingOptionUpdates);
}
@Override
public ApplicationUpdate build() {
return new ApplicationUpdate(this);
}
}
}