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.storagegateway.model;
 
Disk
 
 public class Disk implements SerializableCloneable {
 
     private String diskId;
 
     private String diskPath;
 
     private String diskNode;
 
     private String diskStatus;
 
     private Long diskSizeInBytes;
 
     private String diskAllocationType;
 
     private String diskAllocationResource;

    
Returns the value of the DiskId property for this object.

Constraints:
Length: 1 - 300

Returns:
The value of the DiskId property for this object.
 
     public String getDiskId() {
         return ;
     }
    
    
Sets the value of the DiskId property for this object.

Constraints:
Length: 1 - 300

Parameters:
diskId The new value for the DiskId property for this object.
 
     public void setDiskId(String diskId) {
         this. = diskId;
     }
    
    
Sets the value of the DiskId property for this object.

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

Constraints:
Length: 1 - 300

Parameters:
diskId The new value for the DiskId property for this object.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public Disk withDiskId(String diskId) {
         this. = diskId;
         return this;
     }

    
Returns the value of the DiskPath property for this object.

Returns:
The value of the DiskPath property for this object.
 
     public String getDiskPath() {
         return ;
     }
    
    
Sets the value of the DiskPath property for this object.

Parameters:
diskPath The new value for the DiskPath property for this object.
 
     public void setDiskPath(String diskPath) {
         this. = diskPath;
     }
    
    
Sets the value of the DiskPath property for this object.

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

Parameters:
diskPath The new value for the DiskPath property for this object.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Disk withDiskPath(String diskPath) {
        this. = diskPath;
        return this;
    }

    
Returns the value of the DiskNode property for this object.

Returns:
The value of the DiskNode property for this object.
    public String getDiskNode() {
        return ;
    }
    
    
Sets the value of the DiskNode property for this object.

Parameters:
diskNode The new value for the DiskNode property for this object.
    public void setDiskNode(String diskNode) {
        this. = diskNode;
    }
    
    
Sets the value of the DiskNode property for this object.

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

Parameters:
diskNode The new value for the DiskNode property for this object.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Disk withDiskNode(String diskNode) {
        this. = diskNode;
        return this;
    }

    
Returns the value of the DiskStatus property for this object.

Returns:
The value of the DiskStatus property for this object.
    public String getDiskStatus() {
        return ;
    }
    
    
Sets the value of the DiskStatus property for this object.

Parameters:
diskStatus The new value for the DiskStatus property for this object.
    public void setDiskStatus(String diskStatus) {
        this. = diskStatus;
    }
    
    
Sets the value of the DiskStatus property for this object.

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

Parameters:
diskStatus The new value for the DiskStatus property for this object.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Disk withDiskStatus(String diskStatus) {
        this. = diskStatus;
        return this;
    }

    
Returns the value of the DiskSizeInBytes property for this object.

Returns:
The value of the DiskSizeInBytes property for this object.
    public Long getDiskSizeInBytes() {
        return ;
    }
    
    
Sets the value of the DiskSizeInBytes property for this object.

Parameters:
diskSizeInBytes The new value for the DiskSizeInBytes property for this object.
    public void setDiskSizeInBytes(Long diskSizeInBytes) {
        this. = diskSizeInBytes;
    }
    
    
Sets the value of the DiskSizeInBytes property for this object.

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

Parameters:
diskSizeInBytes The new value for the DiskSizeInBytes property for this object.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Disk withDiskSizeInBytes(Long diskSizeInBytes) {
        this. = diskSizeInBytes;
        return this;
    }

    
Returns the value of the DiskAllocationType property for this object.

Constraints:
Length: 3 - 100

Returns:
The value of the DiskAllocationType property for this object.
    public String getDiskAllocationType() {
        return ;
    }
    
    
Sets the value of the DiskAllocationType property for this object.

Constraints:
Length: 3 - 100

Parameters:
diskAllocationType The new value for the DiskAllocationType property for this object.
    public void setDiskAllocationType(String diskAllocationType) {
        this. = diskAllocationType;
    }
    
    
Sets the value of the DiskAllocationType property for this object.

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

Constraints:
Length: 3 - 100

Parameters:
diskAllocationType The new value for the DiskAllocationType property for this object.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Disk withDiskAllocationType(String diskAllocationType) {
        this. = diskAllocationType;
        return this;
    }

    
Returns the value of the DiskAllocationResource property for this object.

Returns:
The value of the DiskAllocationResource property for this object.
    public String getDiskAllocationResource() {
        return ;
    }
    
    
Sets the value of the DiskAllocationResource property for this object.

Parameters:
diskAllocationResource The new value for the DiskAllocationResource property for this object.
    public void setDiskAllocationResource(String diskAllocationResource) {
        this. = diskAllocationResource;
    }
    
    
Sets the value of the DiskAllocationResource property for this object.

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

Parameters:
diskAllocationResource The new value for the DiskAllocationResource property for this object.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Disk withDiskAllocationResource(String diskAllocationResource) {
        this. = diskAllocationResource;
        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 (getDiskId() != nullsb.append("DiskId: " + getDiskId() + ",");
        if (getDiskPath() != nullsb.append("DiskPath: " + getDiskPath() + ",");
        if (getDiskNode() != nullsb.append("DiskNode: " + getDiskNode() + ",");
        if (getDiskStatus() != nullsb.append("DiskStatus: " + getDiskStatus() + ",");
        if (getDiskSizeInBytes() != nullsb.append("DiskSizeInBytes: " + getDiskSizeInBytes() + ",");
        if (getDiskAllocationType() != nullsb.append("DiskAllocationType: " + getDiskAllocationType() + ",");
        if (getDiskAllocationResource() != nullsb.append("DiskAllocationResource: " + getDiskAllocationResource() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getDiskId() == null) ? 0 : getDiskId().hashCode()); 
        hashCode = prime * hashCode + ((getDiskPath() == null) ? 0 : getDiskPath().hashCode()); 
        hashCode = prime * hashCode + ((getDiskNode() == null) ? 0 : getDiskNode().hashCode()); 
        hashCode = prime * hashCode + ((getDiskStatus() == null) ? 0 : getDiskStatus().hashCode()); 
        hashCode = prime * hashCode + ((getDiskSizeInBytes() == null) ? 0 : getDiskSizeInBytes().hashCode()); 
        hashCode = prime * hashCode + ((getDiskAllocationType() == null) ? 0 : getDiskAllocationType().hashCode()); 
        hashCode = prime * hashCode + ((getDiskAllocationResource() == null) ? 0 : getDiskAllocationResource().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof Disk == falsereturn false;
        Disk other = (Disk)obj;
        
        if (other.getDiskId() == null ^ this.getDiskId() == nullreturn false;
        if (other.getDiskId() != null && other.getDiskId().equals(this.getDiskId()) == falsereturn false
        if (other.getDiskPath() == null ^ this.getDiskPath() == nullreturn false;
        if (other.getDiskPath() != null && other.getDiskPath().equals(this.getDiskPath()) == falsereturn false
        if (other.getDiskNode() == null ^ this.getDiskNode() == nullreturn false;
        if (other.getDiskNode() != null && other.getDiskNode().equals(this.getDiskNode()) == falsereturn false
        if (other.getDiskStatus() == null ^ this.getDiskStatus() == nullreturn false;
        if (other.getDiskStatus() != null && other.getDiskStatus().equals(this.getDiskStatus()) == falsereturn false
        if (other.getDiskSizeInBytes() == null ^ this.getDiskSizeInBytes() == nullreturn false;
        if (other.getDiskSizeInBytes() != null && other.getDiskSizeInBytes().equals(this.getDiskSizeInBytes()) == falsereturn false
        if (other.getDiskAllocationType() == null ^ this.getDiskAllocationType() == nullreturn false;
        if (other.getDiskAllocationType() != null && other.getDiskAllocationType().equals(this.getDiskAllocationType()) == falsereturn false
        if (other.getDiskAllocationResource() == null ^ this.getDiskAllocationResource() == nullreturn false;
        if (other.getDiskAllocationResource() != null && other.getDiskAllocationResource().equals(this.getDiskAllocationResource()) == falsereturn false
        return true;
    }
    
    @Override
    public Disk clone() {
        try {
            return (Disksuper.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