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;
 
 
Container for the parameters to the DescribeSnapshots operation.

Obtains information about the directory snapshots that belong to this account.

This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the DescribeSnapshots.NextToken member contains a token that you pass in the next call to DescribeSnapshots to retrieve the next set of items.

You can also specify a maximum number of return results with the Limit parameter.

 
 public class DescribeSnapshotsRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The identifier of the directory to retrieve snapshot information for.

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

 
     private String directoryId;

    
A list of identifiers of the snapshots to obtain the information for. If this member is null or empty, all snapshots are returned using the Limit and NextToken members.
 
The DescribeSnapshotsResult.NextToken value from a previous call to DescribeSnapshots. Pass null if this is the first call.
 
     private String nextToken;

    
The maximum number of objects to return.

Constraints:
Range: 0 -

 
     private Integer limit;

    
The identifier of the directory to retrieve snapshot information for.

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

Returns:
The identifier of the directory to retrieve snapshot information for.
 
     public String getDirectoryId() {
         return ;
     }
    
    
The identifier of the directory to retrieve snapshot information for.

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

Parameters:
directoryId The identifier of the directory to retrieve snapshot information for.
 
     public void setDirectoryId(String directoryId) {
         this. = directoryId;
     }
    
    
The identifier of the directory to retrieve snapshot information for.

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

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

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

    
A list of identifiers of the snapshots to obtain the information for. If this member is null or empty, all snapshots are returned using the Limit and NextToken members.

Returns:
A list of identifiers of the snapshots to obtain the information for. If this member is null or empty, all snapshots are returned using the Limit and NextToken members.
    public java.util.List<StringgetSnapshotIds() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A list of identifiers of the snapshots to obtain the information for. If this member is null or empty, all snapshots are returned using the Limit and NextToken members.

Parameters:
snapshotIds A list of identifiers of the snapshots to obtain the information for. If this member is null or empty, all snapshots are returned using the Limit and NextToken members.
    public void setSnapshotIds(java.util.Collection<StringsnapshotIds) {
        if (snapshotIds == null) {
            this. = null;
            return;
        }
        snapshotIdsCopy.addAll(snapshotIds);
        this. = snapshotIdsCopy;
    }
    
    
A list of identifiers of the snapshots to obtain the information for. If this member is null or empty, all snapshots are returned using the Limit and NextToken members.

NOTE: This method appends the values to the existing list (if any). Use setSnapshotIds(java.util.Collection) or withSnapshotIds(java.util.Collection) if you want to override the existing values.

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

Parameters:
snapshotIds A list of identifiers of the snapshots to obtain the information for. If this member is null or empty, all snapshots are returned using the Limit and NextToken members.
Returns:
A reference to this updated object so that method calls can be chained together.
    public DescribeSnapshotsRequest withSnapshotIds(String... snapshotIds) {
        if (getSnapshotIds() == nullsetSnapshotIds(new java.util.ArrayList<String>(snapshotIds.length));
        for (String value : snapshotIds) {
            getSnapshotIds().add(value);
        }
        return this;
    }
    
    
A list of identifiers of the snapshots to obtain the information for. If this member is null or empty, all snapshots are returned using the Limit and NextToken members.

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

Parameters:
snapshotIds A list of identifiers of the snapshots to obtain the information for. If this member is null or empty, all snapshots are returned using the Limit and NextToken members.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (snapshotIds == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringsnapshotIdsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(snapshotIds.size());
            snapshotIdsCopy.addAll(snapshotIds);
            this. = snapshotIdsCopy;
        }
        return this;
    }

    
The DescribeSnapshotsResult.NextToken value from a previous call to DescribeSnapshots. Pass null if this is the first call.

Returns:
The DescribeSnapshotsResult.NextToken value from a previous call to DescribeSnapshots. Pass null if this is the first call.
    public String getNextToken() {
        return ;
    }
    
    
The DescribeSnapshotsResult.NextToken value from a previous call to DescribeSnapshots. Pass null if this is the first call.

Parameters:
nextToken The DescribeSnapshotsResult.NextToken value from a previous call to DescribeSnapshots. Pass null if this is the first call.
    public void setNextToken(String nextToken) {
        this. = nextToken;
    }
    
    
The DescribeSnapshotsResult.NextToken value from a previous call to DescribeSnapshots. Pass null if this is the first call.

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

Parameters:
nextToken The DescribeSnapshotsResult.NextToken value from a previous call to DescribeSnapshots. Pass null if this is the first call.
Returns:
A reference to this updated object so that method calls can be chained together.
    public DescribeSnapshotsRequest withNextToken(String nextToken) {
        this. = nextToken;
        return this;
    }

    
The maximum number of objects to return.

Constraints:
Range: 0 -

Returns:
The maximum number of objects to return.
    public Integer getLimit() {
        return ;
    }
    
    
The maximum number of objects to return.

Constraints:
Range: 0 -

Parameters:
limit The maximum number of objects to return.
    public void setLimit(Integer limit) {
        this. = limit;
    }
    
    
The maximum number of objects to return.

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

Constraints:
Range: 0 -

Parameters:
limit The maximum number of objects to return.
Returns:
A reference to this updated object so that method calls can be chained together.
    public DescribeSnapshotsRequest withLimit(Integer limit) {
        this. = limit;
        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 (getSnapshotIds() != nullsb.append("SnapshotIds: " + getSnapshotIds() + ",");
        if (getNextToken() != nullsb.append("NextToken: " + getNextToken() + ",");
        if (getLimit() != nullsb.append("Limit: " + getLimit() );
        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 + ((getSnapshotIds() == null) ? 0 : getSnapshotIds().hashCode()); 
        hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); 
        hashCode = prime * hashCode + ((getLimit() == null) ? 0 : getLimit().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof DescribeSnapshotsRequest == falsereturn false;
        DescribeSnapshotsRequest other = (DescribeSnapshotsRequest)obj;
        
        if (other.getDirectoryId() == null ^ this.getDirectoryId() == nullreturn false;
        if (other.getDirectoryId() != null && other.getDirectoryId().equals(this.getDirectoryId()) == falsereturn false
        if (other.getSnapshotIds() == null ^ this.getSnapshotIds() == nullreturn false;
        if (other.getSnapshotIds() != null && other.getSnapshotIds().equals(this.getSnapshotIds()) == falsereturn false
        if (other.getNextToken() == null ^ this.getNextToken() == nullreturn false;
        if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == falsereturn false
        if (other.getLimit() == null ^ this.getLimit() == nullreturn false;
        if (other.getLimit() != null && other.getLimit().equals(this.getLimit()) == falsereturn false
        return true;
    }
    
    @Override
    public DescribeSnapshotsRequest clone() {
        
            return (DescribeSnapshotsRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X