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.directory.model;
 

Describes a directory snapshot.

 
 public class Snapshot implements SerializableCloneable {

    
The directory identifier.

Constraints:
Pattern: ^d-[0-9a-f]{10}$

 
     private String directoryId;

    
The snapshot identifier.

Constraints:
Pattern: ^s-[0-9a-f]{10}$

 
     private String snapshotId;

    
The snapshot type.

Constraints:
Allowed Values: Auto, Manual

 
     private String type;

    
The descriptive name of the snapshot.

Constraints:
Length: 0 - 128
Pattern: ^([a-zA-Z0-9_])[\\a-zA-Z0-9_@#%*+=:?./!\s-]*$

 
     private String name;

    
The snapshot status.

Constraints:
Allowed Values: Creating, Completed, Failed

 
     private String status;

    
The date and time that the snapshot was taken.
 
     private java.util.Date startTime;

    
The directory identifier.

Constraints:
Pattern: ^d-[0-9a-f]{10}$

Returns:
The directory identifier.
 
     public String getDirectoryId() {
         return ;
     }
    
    
The directory identifier.

Constraints:
Pattern: ^d-[0-9a-f]{10}$

Parameters:
directoryId The directory identifier.
 
     public void setDirectoryId(String directoryId) {
         this. = directoryId;
     }
    
    
The directory identifier.

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

Constraints:
Pattern: ^d-[0-9a-f]{10}$

Parameters:
directoryId The directory identifier.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Snapshot withDirectoryId(String directoryId) {
        this. = directoryId;
        return this;
    }

    
The snapshot identifier.

Constraints:
Pattern: ^s-[0-9a-f]{10}$

Returns:
The snapshot identifier.
    public String getSnapshotId() {
        return ;
    }
    
    
The snapshot identifier.

Constraints:
Pattern: ^s-[0-9a-f]{10}$

Parameters:
snapshotId The snapshot identifier.
    public void setSnapshotId(String snapshotId) {
        this. = snapshotId;
    }
    
    
The snapshot identifier.

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

Constraints:
Pattern: ^s-[0-9a-f]{10}$

Parameters:
snapshotId The snapshot identifier.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Snapshot withSnapshotId(String snapshotId) {
        this. = snapshotId;
        return this;
    }

    
The snapshot type.

Constraints:
Allowed Values: Auto, Manual

Returns:
The snapshot type.
See also:
SnapshotType
    public String getType() {
        return ;
    }
    
    
The snapshot type.

Constraints:
Allowed Values: Auto, Manual

Parameters:
type The snapshot type.
See also:
SnapshotType
    public void setType(String type) {
        this. = type;
    }
    
    
The snapshot type.

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

Constraints:
Allowed Values: Auto, Manual

Parameters:
type The snapshot type.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
SnapshotType
    public Snapshot withType(String type) {
        this. = type;
        return this;
    }

    
The snapshot type.

Constraints:
Allowed Values: Auto, Manual

Parameters:
type The snapshot type.
See also:
SnapshotType
    public void setType(SnapshotType type) {
        this. = type.toString();
    }
    
    
The snapshot type.

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

Constraints:
Allowed Values: Auto, Manual

Parameters:
type The snapshot type.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
SnapshotType
    public Snapshot withType(SnapshotType type) {
        this. = type.toString();
        return this;
    }

    
The descriptive name of the snapshot.

Constraints:
Length: 0 - 128
Pattern: ^([a-zA-Z0-9_])[\\a-zA-Z0-9_@#%*+=:?./!\s-]*$

Returns:
The descriptive name of the snapshot.
    public String getName() {
        return ;
    }
    
    
The descriptive name of the snapshot.

Constraints:
Length: 0 - 128
Pattern: ^([a-zA-Z0-9_])[\\a-zA-Z0-9_@#%*+=:?./!\s-]*$

Parameters:
name The descriptive name of the snapshot.
    public void setName(String name) {
        this. = name;
    }
    
    
The descriptive name of the snapshot.

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

Constraints:
Length: 0 - 128
Pattern: ^([a-zA-Z0-9_])[\\a-zA-Z0-9_@#%*+=:?./!\s-]*$

Parameters:
name The descriptive name of the snapshot.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Snapshot withName(String name) {
        this. = name;
        return this;
    }

    
The snapshot status.

Constraints:
Allowed Values: Creating, Completed, Failed

Returns:
The snapshot status.
See also:
SnapshotStatus
    public String getStatus() {
        return ;
    }
    
    
The snapshot status.

Constraints:
Allowed Values: Creating, Completed, Failed

Parameters:
status The snapshot status.
See also:
SnapshotStatus
    public void setStatus(String status) {
        this. = status;
    }
    
    
The snapshot status.

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

Constraints:
Allowed Values: Creating, Completed, Failed

Parameters:
status The snapshot status.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
SnapshotStatus
    public Snapshot withStatus(String status) {
        this. = status;
        return this;
    }

    
The snapshot status.

Constraints:
Allowed Values: Creating, Completed, Failed

Parameters:
status The snapshot status.
See also:
SnapshotStatus
    public void setStatus(SnapshotStatus status) {
        this. = status.toString();
    }
    
    
The snapshot status.

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

Constraints:
Allowed Values: Creating, Completed, Failed

Parameters:
status The snapshot status.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
SnapshotStatus
    public Snapshot withStatus(SnapshotStatus status) {
        this. = status.toString();
        return this;
    }

    
The date and time that the snapshot was taken.

Returns:
The date and time that the snapshot was taken.
    public java.util.Date getStartTime() {
        return ;
    }
    
    
The date and time that the snapshot was taken.

Parameters:
startTime The date and time that the snapshot was taken.
    public void setStartTime(java.util.Date startTime) {
        this. = startTime;
    }
    
    
The date and time that the snapshot was taken.

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

Parameters:
startTime The date and time that the snapshot was taken.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Snapshot withStartTime(java.util.Date startTime) {
        this. = startTime;
        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 (getDirectoryId() != nullsb.append("DirectoryId: " + getDirectoryId() + ",");
        if (getSnapshotId() != nullsb.append("SnapshotId: " + getSnapshotId() + ",");
        if (getType() != nullsb.append("Type: " + getType() + ",");
        if (getName() != nullsb.append("Name: " + getName() + ",");
        if (getStatus() != nullsb.append("Status: " + getStatus() + ",");
        if (getStartTime() != nullsb.append("StartTime: " + getStartTime() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getDirectoryId() == null) ? 0 : getDirectoryId().hashCode()); 
        hashCode = prime * hashCode + ((getSnapshotId() == null) ? 0 : getSnapshotId().hashCode()); 
        hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); 
        hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); 
        hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); 
        hashCode = prime * hashCode + ((getStartTime() == null) ? 0 : getStartTime().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof Snapshot == falsereturn false;
        Snapshot other = (Snapshot)obj;
        
        if (other.getDirectoryId() == null ^ this.getDirectoryId() == nullreturn false;
        if (other.getDirectoryId() != null && other.getDirectoryId().equals(this.getDirectoryId()) == falsereturn false
        if (other.getSnapshotId() == null ^ this.getSnapshotId() == nullreturn false;
        if (other.getSnapshotId() != null && other.getSnapshotId().equals(this.getSnapshotId()) == falsereturn false
        if (other.getType() == null ^ this.getType() == nullreturn false;
        if (other.getType() != null && other.getType().equals(this.getType()) == falsereturn false
        if (other.getName() == null ^ this.getName() == nullreturn false;
        if (other.getName() != null && other.getName().equals(this.getName()) == falsereturn false
        if (other.getStatus() == null ^ this.getStatus() == nullreturn false;
        if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == falsereturn false
        if (other.getStartTime() == null ^ this.getStartTime() == nullreturn false;
        if (other.getStartTime() != null && other.getStartTime().equals(this.getStartTime()) == falsereturn false
        return true;
    }
    
    @Override
    public Snapshot clone() {
        try {
            return (Snapshotsuper.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