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.
 
     private String type;

    

The tag filter key.

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

    

The tag filter key.

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

    

The tag filter key.

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

    

The tag filter value.

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

    

The tag filter value.

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

    

The tag filter value.

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

    

The tag filter type:

  • KEY_ONLY: Key only.
  • VALUE_ONLY: Value only.
  • KEY_AND_VALUE: 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:
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 this.;
    }

    

The tag filter type:

  • KEY_ONLY: Key only.
  • VALUE_ONLY: Value only.
  • KEY_AND_VALUE: Key and value.

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

    

The tag filter type:

  • KEY_ONLY: Key only.
  • VALUE_ONLY: Value only.
  • KEY_AND_VALUE: Key and value.

Parameters:
type The tag filter type:
  • KEY_ONLY: Key only.
  • VALUE_ONLY: Value only.
  • KEY_AND_VALUE: Key and value.
Returns:
Returns a reference to this object so that method calls can be chained together.
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.

Parameters:
type The tag filter type:
  • KEY_ONLY: Key only.
  • VALUE_ONLY: Value only.
  • KEY_AND_VALUE: Key and value.
Returns:
Returns a reference to this object so that method calls can be chained together.
See also:
EC2TagFilterType
    public EC2TagFilter withType(EC2TagFilterType type) {
        setType(type);
        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() != null)
            sb.append("Key: " + getKey() + ",");
        if (getValue() != null)
            sb.append("Value: " + getValue() + ",");
        if (getType() != null)
            sb.append("Type: " + getType());
        sb.append("}");
        return sb.toString();
    }
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (obj instanceof EC2TagFilter == false)
            return false;
        EC2TagFilter other = (EC2TagFilterobj;
        if (other.getKey() == null ^ this.getKey() == null)
            return false;
        if (other.getKey() != null
                && other.getKey().equals(this.getKey()) == false)
            return false;
        if (other.getValue() == null ^ this.getValue() == null)
            return false;
        if (other.getValue() != null
                && other.getValue().equals(this.getValue()) == false)
            return false;
        if (other.getType() == null ^ this.getType() == null)
            return false;
        if (other.getType() != null
                && other.getType().equals(this.getType()) == false)
            return false;
        return true;
    }
    @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 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