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

Creates or overwrites tags associated with a file system. Each tag is a key-value pair. If a tag key specified in the request already exists on the file system, this operation overwrites its value with the value provided in the request. If you add the "Name" tag to your file system, Amazon EFS returns it in the response to the DescribeFileSystems API.

This operation requires permission for the elasticfilesystem:CreateTags action.

 
 public class CreateTagsRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
String. The ID of the file system whose tags you want to modify. This operation modifies only the tags and not the file system.

Constraints:
Pattern: fs-[0-9a-f]{8}

 
     private String fileSystemId;

    
An array of Tag objects to add. Each Tag object is a key-value pair.
 
String. The ID of the file system whose tags you want to modify. This operation modifies only the tags and not the file system.

Constraints:
Pattern: fs-[0-9a-f]{8}

Returns:
String. The ID of the file system whose tags you want to modify. This operation modifies only the tags and not the file system.
 
     public String getFileSystemId() {
         return ;
     }
    
    
String. The ID of the file system whose tags you want to modify. This operation modifies only the tags and not the file system.

Constraints:
Pattern: fs-[0-9a-f]{8}

Parameters:
fileSystemId String. The ID of the file system whose tags you want to modify. This operation modifies only the tags and not the file system.
 
     public void setFileSystemId(String fileSystemId) {
         this. = fileSystemId;
     }
    
    
String. The ID of the file system whose tags you want to modify. This operation modifies only the tags and not the file system.

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

Constraints:
Pattern: fs-[0-9a-f]{8}

Parameters:
fileSystemId String. The ID of the file system whose tags you want to modify. This operation modifies only the tags and not the file system.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateTagsRequest withFileSystemId(String fileSystemId) {
         this. = fileSystemId;
        return this;
    }

    
An array of Tag objects to add. Each Tag object is a key-value pair.

Returns:
An array of Tag objects to add. Each Tag object is a key-value pair.
    public java.util.List<TaggetTags() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<Tag>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
An array of Tag objects to add. Each Tag object is a key-value pair.

Parameters:
tags An array of Tag objects to add. Each Tag object is a key-value pair.
    public void setTags(java.util.Collection<Tagtags) {
        if (tags == null) {
            this. = null;
            return;
        }
        tagsCopy.addAll(tags);
        this. = tagsCopy;
    }
    
    
An array of Tag objects to add. Each Tag object is a key-value pair.

NOTE: This method appends the values to the existing list (if any). Use setTags(java.util.Collection) or withTags(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:
tags An array of Tag objects to add. Each Tag object is a key-value pair.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateTagsRequest withTags(Tag... tags) {
        if (getTags() == nullsetTags(new java.util.ArrayList<Tag>(tags.length));
        for (Tag value : tags) {
            getTags().add(value);
        }
        return this;
    }
    
    
An array of Tag objects to add. Each Tag object is a key-value pair.

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

Parameters:
tags An array of Tag objects to add. Each Tag object is a key-value pair.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateTagsRequest withTags(java.util.Collection<Tagtags) {
        if (tags == null) {
            this. = null;
        } else {
            tagsCopy.addAll(tags);
            this. = tagsCopy;
        }
        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 (getFileSystemId() != nullsb.append("FileSystemId: " + getFileSystemId() + ",");
        if (getTags() != nullsb.append("Tags: " + getTags() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getFileSystemId() == null) ? 0 : getFileSystemId().hashCode()); 
        hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof CreateTagsRequest == falsereturn false;
        CreateTagsRequest other = (CreateTagsRequest)obj;
        
        if (other.getFileSystemId() == null ^ this.getFileSystemId() == nullreturn false;
        if (other.getFileSystemId() != null && other.getFileSystemId().equals(this.getFileSystemId()) == falsereturn false
        if (other.getTags() == null ^ this.getTags() == nullreturn false;
        if (other.getTags() != null && other.getTags().equals(this.getTags()) == falsereturn false
        return true;
    }
    
    @Override
    public CreateTagsRequest clone() {
        
            return (CreateTagsRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X