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

Information about a tag filter.

 
 public class EC2TagFilter implements SerializableCloneable {

    
The tag filter key.
 
     private String key;

    
The tag filter value.
 
     private String value;

    
The tag filter type:
  • KEY_ONLY: Key only.
  • VALUE_ONLY: Value only.
  • KEY_AND_VALUE: Key and value.

Constraints:
Allowed Values: KEY_ONLY, VALUE_ONLY, KEY_AND_VALUE

 
     private String type;

    
The tag filter key.

Returns:
The tag filter key.
 
     public String getKey() {
         return ;
     }
    
    
The tag filter key.

Parameters:
key The tag filter key.
 
     public void setKey(String key) {
         this. = key;
     }
    
    
The tag filter key.

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

Parameters:
key The tag filter key.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public EC2TagFilter withKey(String key) {
         this. = key;
         return this;
     }

    
The tag filter value.

Returns:
The tag filter value.
 
     public String getValue() {
         return ;
     }
    
    
The tag filter value.

Parameters:
value The tag filter value.
 
     public void setValue(String value) {
         this. = value;
     }
    
    
The tag filter value.

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

Parameters:
value The tag filter value.
Returns:
A reference to this updated object so that method calls can be chained together.
    public EC2TagFilter withValue(String value) {
        this. = value;
        return this;
    }

    
The tag filter type:
  • KEY_ONLY: Key only.
  • VALUE_ONLY: Value only.
  • KEY_AND_VALUE: Key and value.

Constraints:
Allowed Values: KEY_ONLY, VALUE_ONLY, KEY_AND_VALUE

Returns:
The tag filter type:
  • KEY_ONLY: Key only.
  • VALUE_ONLY: Value only.
  • KEY_AND_VALUE: Key and value.
See also:
EC2TagFilterType
    public String getType() {
        return ;
    }
    
    
The tag filter type:
  • KEY_ONLY: Key only.
  • VALUE_ONLY: Value only.
  • KEY_AND_VALUE: Key and value.

Constraints:
Allowed Values: KEY_ONLY, VALUE_ONLY, KEY_AND_VALUE

Parameters:
type The tag filter type:
  • KEY_ONLY: Key only.
  • VALUE_ONLY: Value only.
  • KEY_AND_VALUE: Key and value.
See also:
EC2TagFilterType
    public void setType(String type) {
        this. = type;
    }
    
    
The tag filter type:
  • KEY_ONLY: Key only.
  • VALUE_ONLY: Value only.
  • KEY_AND_VALUE: Key and value.

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

Constraints:
Allowed Values: KEY_ONLY, VALUE_ONLY, KEY_AND_VALUE

Parameters:
type The tag filter type:
  • KEY_ONLY: Key only.
  • VALUE_ONLY: Value only.
  • KEY_AND_VALUE: Key and value.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
EC2TagFilterType
    public EC2TagFilter withType(String type) {
        this. = type;
        return this;
    }

    
The tag filter type:
  • KEY_ONLY: Key only.
  • VALUE_ONLY: Value only.
  • KEY_AND_VALUE: Key and value.

Constraints:
Allowed Values: KEY_ONLY, VALUE_ONLY, KEY_AND_VALUE

Parameters:
type The tag filter type:
  • KEY_ONLY: Key only.
  • VALUE_ONLY: Value only.
  • KEY_AND_VALUE: Key and value.
See also:
EC2TagFilterType
    public void setType(EC2TagFilterType type) {
        this. = type.toString();
    }
    
    
The tag filter type:
  • KEY_ONLY: Key only.
  • VALUE_ONLY: Value only.
  • KEY_AND_VALUE: Key and value.

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

Constraints:
Allowed Values: KEY_ONLY, VALUE_ONLY, KEY_AND_VALUE

Parameters:
type The tag filter type:
  • KEY_ONLY: Key only.
  • VALUE_ONLY: Value only.
  • KEY_AND_VALUE: Key and value.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
EC2TagFilterType
    public EC2TagFilter withType(EC2TagFilterType type) {
        this. = type.toString();
        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 (getKey() != nullsb.append("Key: " + getKey() + ",");
        if (getValue() != nullsb.append("Value: " + getValue() + ",");
        if (getType() != nullsb.append("Type: " + getType() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getKey() == null) ? 0 : getKey().hashCode()); 
        hashCode = prime * hashCode + ((getValue() == null) ? 0 : getValue().hashCode()); 
        hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof EC2TagFilter == falsereturn false;
        EC2TagFilter other = (EC2TagFilter)obj;
        
        if (other.getKey() == null ^ this.getKey() == nullreturn false;
        if (other.getKey() != null && other.getKey().equals(this.getKey()) == falsereturn false
        if (other.getValue() == null ^ this.getValue() == nullreturn false;
        if (other.getValue() != null && other.getValue().equals(this.getValue()) == falsereturn false
        if (other.getType() == null ^ this.getType() == nullreturn false;
        if (other.getType() != null && other.getType().equals(this.getType()) == falsereturn false
        return true;
    }
    
    @Override
    public EC2TagFilter clone() {
        try {
            return (EC2TagFiltersuper.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