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;
 

Represents an individual cache node in a snapshot of a cache cluster.

 
 public class NodeSnapshot implements SerializableCloneable {

    
The cache node identifier for the node in the source cache cluster.
 
     private String cacheNodeId;

    
The size of the cache on the source cache node.
 
     private String cacheSize;

    
The date and time when the cache node was created in the source cache cluster.
 
     private java.util.Date cacheNodeCreateTime;

    
The date and time when the source node's metadata and cache data set was obtained for the snapshot.
 
     private java.util.Date snapshotCreateTime;

    
The cache node identifier for the node in the source cache cluster.

Returns:
The cache node identifier for the node in the source cache cluster.
 
     public String getCacheNodeId() {
         return ;
     }
    
    
The cache node identifier for the node in the source cache cluster.

Parameters:
cacheNodeId The cache node identifier for the node in the source cache cluster.
 
     public void setCacheNodeId(String cacheNodeId) {
         this. = cacheNodeId;
     }
    
    
The cache node identifier for the node in the source cache cluster.

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

Parameters:
cacheNodeId The cache node identifier for the node in the source cache cluster.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public NodeSnapshot withCacheNodeId(String cacheNodeId) {
         this. = cacheNodeId;
         return this;
     }

    
The size of the cache on the source cache node.

Returns:
The size of the cache on the source cache node.
 
     public String getCacheSize() {
         return ;
     }
    
    
The size of the cache on the source cache node.

Parameters:
cacheSize The size of the cache on the source cache node.
 
     public void setCacheSize(String cacheSize) {
         this. = cacheSize;
     }
    
    
The size of the cache on the source cache node.

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

Parameters:
cacheSize The size of the cache on the source cache node.
Returns:
A reference to this updated object so that method calls can be chained together.
    public NodeSnapshot withCacheSize(String cacheSize) {
        this. = cacheSize;
        return this;
    }

    
The date and time when the cache node was created in the source cache cluster.

Returns:
The date and time when the cache node was created in the source cache cluster.
    public java.util.Date getCacheNodeCreateTime() {
        return ;
    }
    
    
The date and time when the cache node was created in the source cache cluster.

Parameters:
cacheNodeCreateTime The date and time when the cache node was created in the source cache cluster.
    public void setCacheNodeCreateTime(java.util.Date cacheNodeCreateTime) {
        this. = cacheNodeCreateTime;
    }
    
    
The date and time when the cache node was created in the source cache cluster.

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

Parameters:
cacheNodeCreateTime The date and time when the cache node was created in the source cache cluster.
Returns:
A reference to this updated object so that method calls can be chained together.
    public NodeSnapshot withCacheNodeCreateTime(java.util.Date cacheNodeCreateTime) {
        this. = cacheNodeCreateTime;
        return this;
    }

    
The date and time when the source node's metadata and cache data set was obtained for the snapshot.

Returns:
The date and time when the source node's metadata and cache data set was obtained for the snapshot.
    public java.util.Date getSnapshotCreateTime() {
        return ;
    }
    
    
The date and time when the source node's metadata and cache data set was obtained for the snapshot.

Parameters:
snapshotCreateTime The date and time when the source node's metadata and cache data set was obtained for the snapshot.
    public void setSnapshotCreateTime(java.util.Date snapshotCreateTime) {
        this. = snapshotCreateTime;
    }
    
    
The date and time when the source node's metadata and cache data set was obtained for the snapshot.

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

Parameters:
snapshotCreateTime The date and time when the source node's metadata and cache data set was obtained for the snapshot.
Returns:
A reference to this updated object so that method calls can be chained together.
    public NodeSnapshot withSnapshotCreateTime(java.util.Date snapshotCreateTime) {
        this. = snapshotCreateTime;
        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 (getCacheNodeId() != nullsb.append("CacheNodeId: " + getCacheNodeId() + ",");
        if (getCacheSize() != nullsb.append("CacheSize: " + getCacheSize() + ",");
        if (getCacheNodeCreateTime() != nullsb.append("CacheNodeCreateTime: " + getCacheNodeCreateTime() + ",");
        if (getSnapshotCreateTime() != nullsb.append("SnapshotCreateTime: " + getSnapshotCreateTime() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getCacheNodeId() == null) ? 0 : getCacheNodeId().hashCode()); 
        hashCode = prime * hashCode + ((getCacheSize() == null) ? 0 : getCacheSize().hashCode()); 
        hashCode = prime * hashCode + ((getCacheNodeCreateTime() == null) ? 0 : getCacheNodeCreateTime().hashCode()); 
        hashCode = prime * hashCode + ((getSnapshotCreateTime() == null) ? 0 : getSnapshotCreateTime().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof NodeSnapshot == falsereturn false;
        NodeSnapshot other = (NodeSnapshot)obj;
        
        if (other.getCacheNodeId() == null ^ this.getCacheNodeId() == nullreturn false;
        if (other.getCacheNodeId() != null && other.getCacheNodeId().equals(this.getCacheNodeId()) == falsereturn false
        if (other.getCacheSize() == null ^ this.getCacheSize() == nullreturn false;
        if (other.getCacheSize() != null && other.getCacheSize().equals(this.getCacheSize()) == falsereturn false
        if (other.getCacheNodeCreateTime() == null ^ this.getCacheNodeCreateTime() == nullreturn false;
        if (other.getCacheNodeCreateTime() != null && other.getCacheNodeCreateTime().equals(this.getCacheNodeCreateTime()) == falsereturn false
        if (other.getSnapshotCreateTime() == null ^ this.getSnapshotCreateTime() == nullreturn false;
        if (other.getSnapshotCreateTime() != null && other.getSnapshotCreateTime().equals(this.getSnapshotCreateTime()) == falsereturn false
        return true;
    }
    
    @Override
    public NodeSnapshot clone() {
        try {
            return (NodeSnapshotsuper.clone();
        
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }
        
    }
}
    
New to GrepCode? Check out our FAQ X