com.amazonaws.services.redshift.model.MaintenanceTrack Maven / Gradle / Ivy
Show all versions of aws-java-sdk-redshift Show documentation
/*
* Copyright 2019-2024 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 com.amazonaws.services.redshift.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* Defines a maintenance track that determines which Amazon Redshift version to apply during a maintenance window. If
* the value for MaintenanceTrack
is current
, the cluster is updated to the most recently
* certified maintenance release. If the value is trailing
, the cluster is updated to the previously
* certified maintenance release.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class MaintenanceTrack implements Serializable, Cloneable {
/**
*
* The name of the maintenance track. Possible values are current
and trailing
.
*
*/
private String maintenanceTrackName;
/**
*
* The version number for the cluster release.
*
*/
private String databaseVersion;
/**
*
* An array of UpdateTarget objects to update with the maintenance track.
*
*/
private com.amazonaws.internal.SdkInternalList updateTargets;
/**
*
* The name of the maintenance track. Possible values are current
and trailing
.
*
*
* @param maintenanceTrackName
* The name of the maintenance track. Possible values are current
and trailing
.
*/
public void setMaintenanceTrackName(String maintenanceTrackName) {
this.maintenanceTrackName = maintenanceTrackName;
}
/**
*
* The name of the maintenance track. Possible values are current
and trailing
.
*
*
* @return The name of the maintenance track. Possible values are current
and trailing
.
*/
public String getMaintenanceTrackName() {
return this.maintenanceTrackName;
}
/**
*
* The name of the maintenance track. Possible values are current
and trailing
.
*
*
* @param maintenanceTrackName
* The name of the maintenance track. Possible values are current
and trailing
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MaintenanceTrack withMaintenanceTrackName(String maintenanceTrackName) {
setMaintenanceTrackName(maintenanceTrackName);
return this;
}
/**
*
* The version number for the cluster release.
*
*
* @param databaseVersion
* The version number for the cluster release.
*/
public void setDatabaseVersion(String databaseVersion) {
this.databaseVersion = databaseVersion;
}
/**
*
* The version number for the cluster release.
*
*
* @return The version number for the cluster release.
*/
public String getDatabaseVersion() {
return this.databaseVersion;
}
/**
*
* The version number for the cluster release.
*
*
* @param databaseVersion
* The version number for the cluster release.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MaintenanceTrack withDatabaseVersion(String databaseVersion) {
setDatabaseVersion(databaseVersion);
return this;
}
/**
*
* An array of UpdateTarget objects to update with the maintenance track.
*
*
* @return An array of UpdateTarget objects to update with the maintenance track.
*/
public java.util.List getUpdateTargets() {
if (updateTargets == null) {
updateTargets = new com.amazonaws.internal.SdkInternalList();
}
return updateTargets;
}
/**
*
* An array of UpdateTarget objects to update with the maintenance track.
*
*
* @param updateTargets
* An array of UpdateTarget objects to update with the maintenance track.
*/
public void setUpdateTargets(java.util.Collection updateTargets) {
if (updateTargets == null) {
this.updateTargets = null;
return;
}
this.updateTargets = new com.amazonaws.internal.SdkInternalList(updateTargets);
}
/**
*
* An array of UpdateTarget objects to update with the maintenance track.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setUpdateTargets(java.util.Collection)} or {@link #withUpdateTargets(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param updateTargets
* An array of UpdateTarget objects to update with the maintenance track.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MaintenanceTrack withUpdateTargets(UpdateTarget... updateTargets) {
if (this.updateTargets == null) {
setUpdateTargets(new com.amazonaws.internal.SdkInternalList(updateTargets.length));
}
for (UpdateTarget ele : updateTargets) {
this.updateTargets.add(ele);
}
return this;
}
/**
*
* An array of UpdateTarget objects to update with the maintenance track.
*
*
* @param updateTargets
* An array of UpdateTarget objects to update with the maintenance track.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MaintenanceTrack withUpdateTargets(java.util.Collection updateTargets) {
setUpdateTargets(updateTargets);
return this;
}
/**
* 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.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getMaintenanceTrackName() != null)
sb.append("MaintenanceTrackName: ").append(getMaintenanceTrackName()).append(",");
if (getDatabaseVersion() != null)
sb.append("DatabaseVersion: ").append(getDatabaseVersion()).append(",");
if (getUpdateTargets() != null)
sb.append("UpdateTargets: ").append(getUpdateTargets());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof MaintenanceTrack == false)
return false;
MaintenanceTrack other = (MaintenanceTrack) obj;
if (other.getMaintenanceTrackName() == null ^ this.getMaintenanceTrackName() == null)
return false;
if (other.getMaintenanceTrackName() != null && other.getMaintenanceTrackName().equals(this.getMaintenanceTrackName()) == false)
return false;
if (other.getDatabaseVersion() == null ^ this.getDatabaseVersion() == null)
return false;
if (other.getDatabaseVersion() != null && other.getDatabaseVersion().equals(this.getDatabaseVersion()) == false)
return false;
if (other.getUpdateTargets() == null ^ this.getUpdateTargets() == null)
return false;
if (other.getUpdateTargets() != null && other.getUpdateTargets().equals(this.getUpdateTargets()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getMaintenanceTrackName() == null) ? 0 : getMaintenanceTrackName().hashCode());
hashCode = prime * hashCode + ((getDatabaseVersion() == null) ? 0 : getDatabaseVersion().hashCode());
hashCode = prime * hashCode + ((getUpdateTargets() == null) ? 0 : getUpdateTargets().hashCode());
return hashCode;
}
@Override
public MaintenanceTrack clone() {
try {
return (MaintenanceTrack) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}