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

Information about an AWS service returned by the DescribeServices operation.

 
 public class Service implements SerializableCloneable {

    
The code for an AWS service returned by the DescribeServices response. The Name element contains the corresponding friendly name.
 
     private String code;

    
The friendly name for an AWS service. The Code element contains the corresponding code.
 
     private String name;

    
A list of categories that describe the type of support issue a case describes. Categories consist of a category name and a category code. Category names and codes are passed to AWS Support when you call CreateCase.
 
The code for an AWS service returned by the DescribeServices response. The Name element contains the corresponding friendly name.

Returns:
The code for an AWS service returned by the DescribeServices response. The Name element contains the corresponding friendly name.
 
     public String getCode() {
         return ;
     }
    
    
The code for an AWS service returned by the DescribeServices response. The Name element contains the corresponding friendly name.

Parameters:
code The code for an AWS service returned by the DescribeServices response. The Name element contains the corresponding friendly name.
 
     public void setCode(String code) {
         this. = code;
     }
    
    
The code for an AWS service returned by the DescribeServices response. The Name element contains the corresponding friendly name.

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

Parameters:
code The code for an AWS service returned by the DescribeServices response. The Name element contains the corresponding friendly name.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public Service withCode(String code) {
         this. = code;
         return this;
     }

    
The friendly name for an AWS service. The Code element contains the corresponding code.

Returns:
The friendly name for an AWS service. The Code element contains the corresponding code.
 
    public String getName() {
        return ;
    }
    
    
The friendly name for an AWS service. The Code element contains the corresponding code.

Parameters:
name The friendly name for an AWS service. The Code element contains the corresponding code.
    public void setName(String name) {
        this. = name;
    }
    
    
The friendly name for an AWS service. The Code element contains the corresponding code.

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

Parameters:
name The friendly name for an AWS service. The Code element contains the corresponding code.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Service withName(String name) {
        this. = name;
        return this;
    }

    
A list of categories that describe the type of support issue a case describes. Categories consist of a category name and a category code. Category names and codes are passed to AWS Support when you call CreateCase.

Returns:
A list of categories that describe the type of support issue a case describes. Categories consist of a category name and a category code. Category names and codes are passed to AWS Support when you call CreateCase.
    public java.util.List<CategorygetCategories() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<Category>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A list of categories that describe the type of support issue a case describes. Categories consist of a category name and a category code. Category names and codes are passed to AWS Support when you call CreateCase.

Parameters:
categories A list of categories that describe the type of support issue a case describes. Categories consist of a category name and a category code. Category names and codes are passed to AWS Support when you call CreateCase.
    public void setCategories(java.util.Collection<Categorycategories) {
        if (categories == null) {
            this. = null;
            return;
        }
        categoriesCopy.addAll(categories);
        this. = categoriesCopy;
    }
    
    
A list of categories that describe the type of support issue a case describes. Categories consist of a category name and a category code. Category names and codes are passed to AWS Support when you call CreateCase.

NOTE: This method appends the values to the existing list (if any). Use setCategories(java.util.Collection) or withCategories(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:
categories A list of categories that describe the type of support issue a case describes. Categories consist of a category name and a category code. Category names and codes are passed to AWS Support when you call CreateCase.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Service withCategories(Category... categories) {
        if (getCategories() == nullsetCategories(new java.util.ArrayList<Category>(categories.length));
        for (Category value : categories) {
            getCategories().add(value);
        }
        return this;
    }
    
    
A list of categories that describe the type of support issue a case describes. Categories consist of a category name and a category code. Category names and codes are passed to AWS Support when you call CreateCase.

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

Parameters:
categories A list of categories that describe the type of support issue a case describes. Categories consist of a category name and a category code. Category names and codes are passed to AWS Support when you call CreateCase.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Service withCategories(java.util.Collection<Categorycategories) {
        if (categories == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<CategorycategoriesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<Category>(categories.size());
            categoriesCopy.addAll(categories);
            this. = categoriesCopy;
        }
        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 (getCode() != nullsb.append("Code: " + getCode() + ",");
        if (getName() != nullsb.append("Name: " + getName() + ",");
        if (getCategories() != nullsb.append("Categories: " + getCategories() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getCode() == null) ? 0 : getCode().hashCode()); 
        hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); 
        hashCode = prime * hashCode + ((getCategories() == null) ? 0 : getCategories().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof Service == falsereturn false;
        Service other = (Service)obj;
        
        if (other.getCode() == null ^ this.getCode() == nullreturn false;
        if (other.getCode() != null && other.getCode().equals(this.getCode()) == falsereturn false
        if (other.getName() == null ^ this.getName() == nullreturn false;
        if (other.getName() != null && other.getName().equals(this.getName()) == falsereturn false
        if (other.getCategories() == null ^ this.getCategories() == nullreturn false;
        if (other.getCategories() != null && other.getCategories().equals(this.getCategories()) == falsereturn false
        return true;
    }
    
    @Override
    public Service clone() {
        try {
            return (Servicesuper.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