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

Creates one or more virtual tapes. You write data to the virtual tapes and then archive the tapes.

NOTE:Cache storage must be allocated to the gateway before you can create virtual tapes. Use the AddCache operation to add cache storage to a gateway.

 
 public class CreateTapesRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The unique Amazon Resource Name(ARN) that represents the gateway to associate the virtual tapes with. Use the ListGateways operation to return a list of gateways for your account and region.

Constraints:
Length: 50 - 500

 
     private String gatewayARN;

    
The size, in bytes, of the virtual tapes you want to create. <note>The size must be gigabyte (1024*1024*1024 byte) aligned.</note>
 
     private Long tapeSizeInBytes;

    
A unique identifier that you use to retry a request. If you retry a request, use the same ClientToken you specified in the initial request. <note>Using the same ClientToken prevents creating the tape multiple times.</note>

Constraints:
Length: 5 - 100

 
     private String clientToken;

    
The number of virtual tapes you want to create.

Constraints:
Range: 1 - 10

 
     private Integer numTapesToCreate;

    
A prefix you append to the barcode of the virtual tape you are creating. This makes a barcode unique. <note>The prefix must be 1 to 4 characters in length and must be upper-case letters A-Z.</note>

Constraints:
Length: 1 - 4
Pattern: ^[A-Z]*$

 
     private String tapeBarcodePrefix;

    
The unique Amazon Resource Name(ARN) that represents the gateway to associate the virtual tapes with. Use the ListGateways operation to return a list of gateways for your account and region.

Constraints:
Length: 50 - 500

Returns:
The unique Amazon Resource Name(ARN) that represents the gateway to associate the virtual tapes with. Use the ListGateways operation to return a list of gateways for your account and region.
 
     public String getGatewayARN() {
         return ;
     }
    
    
The unique Amazon Resource Name(ARN) that represents the gateway to associate the virtual tapes with. Use the ListGateways operation to return a list of gateways for your account and region.

Constraints:
Length: 50 - 500

Parameters:
gatewayARN The unique Amazon Resource Name(ARN) that represents the gateway to associate the virtual tapes with. Use the ListGateways operation to return a list of gateways for your account and region.
    public void setGatewayARN(String gatewayARN) {
        this. = gatewayARN;
    }
    
    
The unique Amazon Resource Name(ARN) that represents the gateway to associate the virtual tapes with. Use the ListGateways operation to return a list of gateways for your account and region.

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

Constraints:
Length: 50 - 500

Parameters:
gatewayARN The unique Amazon Resource Name(ARN) that represents the gateway to associate the virtual tapes with. Use the ListGateways operation to return a list of gateways for your account and region.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateTapesRequest withGatewayARN(String gatewayARN) {
        this. = gatewayARN;
        return this;
    }

    
The size, in bytes, of the virtual tapes you want to create. <note>The size must be gigabyte (1024*1024*1024 byte) aligned.</note>

Returns:
The size, in bytes, of the virtual tapes you want to create. <note>The size must be gigabyte (1024*1024*1024 byte) aligned.</note>
    public Long getTapeSizeInBytes() {
        return ;
    }
    
    
The size, in bytes, of the virtual tapes you want to create. <note>The size must be gigabyte (1024*1024*1024 byte) aligned.</note>

Parameters:
tapeSizeInBytes The size, in bytes, of the virtual tapes you want to create. <note>The size must be gigabyte (1024*1024*1024 byte) aligned.</note>
    public void setTapeSizeInBytes(Long tapeSizeInBytes) {
        this. = tapeSizeInBytes;
    }
    
    
The size, in bytes, of the virtual tapes you want to create. <note>The size must be gigabyte (1024*1024*1024 byte) aligned.</note>

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

Parameters:
tapeSizeInBytes The size, in bytes, of the virtual tapes you want to create. <note>The size must be gigabyte (1024*1024*1024 byte) aligned.</note>
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateTapesRequest withTapeSizeInBytes(Long tapeSizeInBytes) {
        this. = tapeSizeInBytes;
        return this;
    }

    
A unique identifier that you use to retry a request. If you retry a request, use the same ClientToken you specified in the initial request. <note>Using the same ClientToken prevents creating the tape multiple times.</note>

Constraints:
Length: 5 - 100

Returns:
A unique identifier that you use to retry a request. If you retry a request, use the same ClientToken you specified in the initial request. <note>Using the same ClientToken prevents creating the tape multiple times.</note>
    public String getClientToken() {
        return ;
    }
    
    
A unique identifier that you use to retry a request. If you retry a request, use the same ClientToken you specified in the initial request. <note>Using the same ClientToken prevents creating the tape multiple times.</note>

Constraints:
Length: 5 - 100

Parameters:
clientToken A unique identifier that you use to retry a request. If you retry a request, use the same ClientToken you specified in the initial request. <note>Using the same ClientToken prevents creating the tape multiple times.</note>
    public void setClientToken(String clientToken) {
        this. = clientToken;
    }
    
    
A unique identifier that you use to retry a request. If you retry a request, use the same ClientToken you specified in the initial request. <note>Using the same ClientToken prevents creating the tape multiple times.</note>

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

Constraints:
Length: 5 - 100

Parameters:
clientToken A unique identifier that you use to retry a request. If you retry a request, use the same ClientToken you specified in the initial request. <note>Using the same ClientToken prevents creating the tape multiple times.</note>
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateTapesRequest withClientToken(String clientToken) {
        this. = clientToken;
        return this;
    }

    
The number of virtual tapes you want to create.

Constraints:
Range: 1 - 10

Returns:
The number of virtual tapes you want to create.
    public Integer getNumTapesToCreate() {
        return ;
    }
    
    
The number of virtual tapes you want to create.

Constraints:
Range: 1 - 10

Parameters:
numTapesToCreate The number of virtual tapes you want to create.
    public void setNumTapesToCreate(Integer numTapesToCreate) {
        this. = numTapesToCreate;
    }
    
    
The number of virtual tapes you want to create.

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

Constraints:
Range: 1 - 10

Parameters:
numTapesToCreate The number of virtual tapes you want to create.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateTapesRequest withNumTapesToCreate(Integer numTapesToCreate) {
        this. = numTapesToCreate;
        return this;
    }

    
A prefix you append to the barcode of the virtual tape you are creating. This makes a barcode unique. <note>The prefix must be 1 to 4 characters in length and must be upper-case letters A-Z.</note>

Constraints:
Length: 1 - 4
Pattern: ^[A-Z]*$

Returns:
A prefix you append to the barcode of the virtual tape you are creating. This makes a barcode unique. <note>The prefix must be 1 to 4 characters in length and must be upper-case letters A-Z.</note>
    public String getTapeBarcodePrefix() {
        return ;
    }
    
    
A prefix you append to the barcode of the virtual tape you are creating. This makes a barcode unique. <note>The prefix must be 1 to 4 characters in length and must be upper-case letters A-Z.</note>

Constraints:
Length: 1 - 4
Pattern: ^[A-Z]*$

Parameters:
tapeBarcodePrefix A prefix you append to the barcode of the virtual tape you are creating. This makes a barcode unique. <note>The prefix must be 1 to 4 characters in length and must be upper-case letters A-Z.</note>
    public void setTapeBarcodePrefix(String tapeBarcodePrefix) {
        this. = tapeBarcodePrefix;
    }
    
    
A prefix you append to the barcode of the virtual tape you are creating. This makes a barcode unique. <note>The prefix must be 1 to 4 characters in length and must be upper-case letters A-Z.</note>

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

Constraints:
Length: 1 - 4
Pattern: ^[A-Z]*$

Parameters:
tapeBarcodePrefix A prefix you append to the barcode of the virtual tape you are creating. This makes a barcode unique. <note>The prefix must be 1 to 4 characters in length and must be upper-case letters A-Z.</note>
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateTapesRequest withTapeBarcodePrefix(String tapeBarcodePrefix) {
        this. = tapeBarcodePrefix;
        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 (getGatewayARN() != nullsb.append("GatewayARN: " + getGatewayARN() + ",");
        if (getTapeSizeInBytes() != nullsb.append("TapeSizeInBytes: " + getTapeSizeInBytes() + ",");
        if (getClientToken() != nullsb.append("ClientToken: " + getClientToken() + ",");
        if (getNumTapesToCreate() != nullsb.append("NumTapesToCreate: " + getNumTapesToCreate() + ",");
        if (getTapeBarcodePrefix() != nullsb.append("TapeBarcodePrefix: " + getTapeBarcodePrefix() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getGatewayARN() == null) ? 0 : getGatewayARN().hashCode()); 
        hashCode = prime * hashCode + ((getTapeSizeInBytes() == null) ? 0 : getTapeSizeInBytes().hashCode()); 
        hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode()); 
        hashCode = prime * hashCode + ((getNumTapesToCreate() == null) ? 0 : getNumTapesToCreate().hashCode()); 
        hashCode = prime * hashCode + ((getTapeBarcodePrefix() == null) ? 0 : getTapeBarcodePrefix().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof CreateTapesRequest == falsereturn false;
        CreateTapesRequest other = (CreateTapesRequest)obj;
        
        if (other.getGatewayARN() == null ^ this.getGatewayARN() == nullreturn false;
        if (other.getGatewayARN() != null && other.getGatewayARN().equals(this.getGatewayARN()) == falsereturn false
        if (other.getTapeSizeInBytes() == null ^ this.getTapeSizeInBytes() == nullreturn false;
        if (other.getTapeSizeInBytes() != null && other.getTapeSizeInBytes().equals(this.getTapeSizeInBytes()) == falsereturn false
        if (other.getClientToken() == null ^ this.getClientToken() == nullreturn false;
        if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == falsereturn false
        if (other.getNumTapesToCreate() == null ^ this.getNumTapesToCreate() == nullreturn false;
        if (other.getNumTapesToCreate() != null && other.getNumTapesToCreate().equals(this.getNumTapesToCreate()) == falsereturn false
        if (other.getTapeBarcodePrefix() == null ^ this.getTapeBarcodePrefix() == nullreturn false;
        if (other.getTapeBarcodePrefix() != null && other.getTapeBarcodePrefix().equals(this.getTapeBarcodePrefix()) == falsereturn false
        return true;
    }
    
    @Override
    public CreateTapesRequest clone() {
        
            return (CreateTapesRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X