Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 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.elasticache.model;
 
 
Container for the parameters to the CopySnapshot operation.

The CopySnapshot action makes a copy of an existing snapshot.

 
 public class CopySnapshotRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The name of an existing snapshot from which to copy.
 
     private String sourceSnapshotName;

    
A name for the copied snapshot.
 
     private String targetSnapshotName;

    
The name of an existing snapshot from which to copy.

Returns:
The name of an existing snapshot from which to copy.
 
     public String getSourceSnapshotName() {
         return ;
     }
    
    
The name of an existing snapshot from which to copy.

Parameters:
sourceSnapshotName The name of an existing snapshot from which to copy.
 
     public void setSourceSnapshotName(String sourceSnapshotName) {
         this. = sourceSnapshotName;
     }
    
    
The name of an existing snapshot from which to copy.

Returns a reference to this object so that method calls can be chained together.

Parameters:
sourceSnapshotName The name of an existing snapshot from which to copy.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CopySnapshotRequest withSourceSnapshotName(String sourceSnapshotName) {
         this. = sourceSnapshotName;
         return this;
     }

    
A name for the copied snapshot.

Returns:
A name for the copied snapshot.
 
     public String getTargetSnapshotName() {
         return ;
     }
    
    
A name for the copied snapshot.

Parameters:
targetSnapshotName A name for the copied snapshot.
 
     public void setTargetSnapshotName(String targetSnapshotName) {
         this. = targetSnapshotName;
     }
    
    
A name for the copied snapshot.

Returns a reference to this object so that method calls can be chained together.

Parameters:
targetSnapshotName A name for the copied snapshot.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CopySnapshotRequest withTargetSnapshotName(String targetSnapshotName) {
        this. = targetSnapshotName;
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getSourceSnapshotName() != nullsb.append("SourceSnapshotName: " + getSourceSnapshotName() + ",");
        if (getTargetSnapshotName() != nullsb.append("TargetSnapshotName: " + getTargetSnapshotName() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getSourceSnapshotName() == null) ? 0 : getSourceSnapshotName().hashCode()); 
        hashCode = prime * hashCode + ((getTargetSnapshotName() == null) ? 0 : getTargetSnapshotName().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof CopySnapshotRequest == falsereturn false;
        CopySnapshotRequest other = (CopySnapshotRequest)obj;
        
        if (other.getSourceSnapshotName() == null ^ this.getSourceSnapshotName() == nullreturn false;
        if (other.getSourceSnapshotName() != null && other.getSourceSnapshotName().equals(this.getSourceSnapshotName()) == falsereturn false
        if (other.getTargetSnapshotName() == null ^ this.getTargetSnapshotName() == nullreturn false;
        if (other.getTargetSnapshotName() != null && other.getTargetSnapshotName().equals(this.getTargetSnapshotName()) == falsereturn false
        return true;
    }
    
    @Override
    public CopySnapshotRequest clone() {
        
            return (CopySnapshotRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X