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

Adds or updates tags for the specified Amazon Kinesis stream. Each stream can have up to 10 tags.

If tags have already been assigned to the stream, AddTagsToStream overwrites any existing tags that correspond to the specified tag keys.

 
 public class AddTagsToStreamRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The name of the stream.

Constraints:
Length: 1 - 128
Pattern: [a-zA-Z0-9_.-]+

 
     private String streamName;

    
The set of key-value pairs to use to create the tags.

Constraints:
Length: 1 - 10

 
     private java.util.Map<String,Stringtags;

    
The name of the stream.

Constraints:
Length: 1 - 128
Pattern: [a-zA-Z0-9_.-]+

Returns:
The name of the stream.
 
     public String getStreamName() {
         return ;
     }
    
    
The name of the stream.

Constraints:
Length: 1 - 128
Pattern: [a-zA-Z0-9_.-]+

Parameters:
streamName The name of the stream.
 
     public void setStreamName(String streamName) {
         this. = streamName;
     }
    
    
The name of the stream.

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

Constraints:
Length: 1 - 128
Pattern: [a-zA-Z0-9_.-]+

Parameters:
streamName The name of the stream.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public AddTagsToStreamRequest withStreamName(String streamName) {
         this. = streamName;
         return this;
     }

    
The set of key-value pairs to use to create the tags.

Constraints:
Length: 1 - 10

Returns:
The set of key-value pairs to use to create the tags.
    public java.util.Map<String,StringgetTags() {
        
        if ( == null) {
             = new java.util.HashMap<String,String>();
        }
        return ;
    }
    
    
The set of key-value pairs to use to create the tags.

Constraints:
Length: 1 - 10

Parameters:
tags The set of key-value pairs to use to create the tags.
    public void setTags(java.util.Map<String,Stringtags) {
        this. = tags;
    }
    
    
The set of key-value pairs to use to create the tags.

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

Constraints:
Length: 1 - 10

Parameters:
tags The set of key-value pairs to use to create the tags.
Returns:
A reference to this updated object so that method calls can be chained together.
        setTags(tags);
        return this;
    }

    
The set of key-value pairs to use to create the tags.

The method adds a new key-value pair into Tags parameter, and returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 10

Parameters:
key The key of the entry to be added into Tags.
value The corresponding value of the entry to be added into Tags.
  public AddTagsToStreamRequest addTagsEntry(String keyString value) {
    if (null == this.) {
      this. = new java.util.HashMap<String,String>();
    }
    if (this..containsKey(key))
      throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
    this..put(keyvalue);
    return this;
  }

  
Removes all the entries added into Tags.

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

    this. = null;
    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 (getStreamName() != nullsb.append("StreamName: " + getStreamName() + ",");
        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 + ((getStreamName() == null) ? 0 : getStreamName().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 AddTagsToStreamRequest == falsereturn false;
        AddTagsToStreamRequest other = (AddTagsToStreamRequest)obj;
        
        if (other.getStreamName() == null ^ this.getStreamName() == nullreturn false;
        if (other.getStreamName() != null && other.getStreamName().equals(this.getStreamName()) == 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 AddTagsToStreamRequest clone() {
        
            return (AddTagsToStreamRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X