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;
 

A communication associated with an AWS Support case. The communication consists of the case ID, the message body, attachment information, the account email address, and the date and time of the communication.

 
 public class Communication implements SerializableCloneable {

    
The AWS Support case ID requested or returned in the call. The case ID is an alphanumeric string formatted as shown in this example: case-12345678910-2013-c4c1d2bf33c5cf47
 
     private String caseId;

    
The text of the communication between the customer and AWS Support.
 
     private String body;

    
The email address of the account that submitted the AWS Support case.
 
     private String submittedBy;

    
The time the communication was created.
 
     private String timeCreated;

    
Information about the attachments to the case communication.
 
The AWS Support case ID requested or returned in the call. The case ID is an alphanumeric string formatted as shown in this example: case-12345678910-2013-c4c1d2bf33c5cf47

Returns:
The AWS Support case ID requested or returned in the call. The case ID is an alphanumeric string formatted as shown in this example: case-12345678910-2013-c4c1d2bf33c5cf47
 
     public String getCaseId() {
         return ;
     }
    
    
The AWS Support case ID requested or returned in the call. The case ID is an alphanumeric string formatted as shown in this example: case-12345678910-2013-c4c1d2bf33c5cf47

Parameters:
caseId The AWS Support case ID requested or returned in the call. The case ID is an alphanumeric string formatted as shown in this example: case-12345678910-2013-c4c1d2bf33c5cf47
 
     public void setCaseId(String caseId) {
         this. = caseId;
     }
    
    
The AWS Support case ID requested or returned in the call. The case ID is an alphanumeric string formatted as shown in this example: case-12345678910-2013-c4c1d2bf33c5cf47

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

Parameters:
caseId The AWS Support case ID requested or returned in the call. The case ID is an alphanumeric string formatted as shown in this example: case-12345678910-2013-c4c1d2bf33c5cf47
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public Communication withCaseId(String caseId) {
         this. = caseId;
         return this;
     }

    
The text of the communication between the customer and AWS Support.

Returns:
The text of the communication between the customer and AWS Support.
    public String getBody() {
        return ;
    }
    
    
The text of the communication between the customer and AWS Support.

Parameters:
body The text of the communication between the customer and AWS Support.
    public void setBody(String body) {
        this. = body;
    }
    
    
The text of the communication between the customer and AWS Support.

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

Parameters:
body The text of the communication between the customer and AWS Support.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Communication withBody(String body) {
        this. = body;
        return this;
    }

    
The email address of the account that submitted the AWS Support case.

Returns:
The email address of the account that submitted the AWS Support case.
    public String getSubmittedBy() {
        return ;
    }
    
    
The email address of the account that submitted the AWS Support case.

Parameters:
submittedBy The email address of the account that submitted the AWS Support case.
    public void setSubmittedBy(String submittedBy) {
        this. = submittedBy;
    }
    
    
The email address of the account that submitted the AWS Support case.

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

Parameters:
submittedBy The email address of the account that submitted the AWS Support case.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Communication withSubmittedBy(String submittedBy) {
        this. = submittedBy;
        return this;
    }

    
The time the communication was created.

Returns:
The time the communication was created.
    public String getTimeCreated() {
        return ;
    }
    
    
The time the communication was created.

Parameters:
timeCreated The time the communication was created.
    public void setTimeCreated(String timeCreated) {
        this. = timeCreated;
    }
    
    
The time the communication was created.

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

Parameters:
timeCreated The time the communication was created.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Communication withTimeCreated(String timeCreated) {
        this. = timeCreated;
        return this;
    }

    
Information about the attachments to the case communication.

Returns:
Information about the attachments to the case communication.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
Information about the attachments to the case communication.

Parameters:
attachmentSet Information about the attachments to the case communication.
    public void setAttachmentSet(java.util.Collection<AttachmentDetailsattachmentSet) {
        if (attachmentSet == null) {
            this. = null;
            return;
        }
        attachmentSetCopy.addAll(attachmentSet);
        this. = attachmentSetCopy;
    }
    
    
Information about the attachments to the case communication.

NOTE: This method appends the values to the existing list (if any). Use setAttachmentSet(java.util.Collection) or withAttachmentSet(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:
attachmentSet Information about the attachments to the case communication.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Communication withAttachmentSet(AttachmentDetails... attachmentSet) {
        if (getAttachmentSet() == nullsetAttachmentSet(new java.util.ArrayList<AttachmentDetails>(attachmentSet.length));
        for (AttachmentDetails value : attachmentSet) {
            getAttachmentSet().add(value);
        }
        return this;
    }
    
    
Information about the attachments to the case communication.

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

Parameters:
attachmentSet Information about the attachments to the case communication.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (attachmentSet == null) {
            this. = null;
        } else {
            attachmentSetCopy.addAll(attachmentSet);
            this. = attachmentSetCopy;
        }
        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 (getCaseId() != nullsb.append("CaseId: " + getCaseId() + ",");
        if (getBody() != nullsb.append("Body: " + getBody() + ",");
        if (getSubmittedBy() != nullsb.append("SubmittedBy: " + getSubmittedBy() + ",");
        if (getTimeCreated() != nullsb.append("TimeCreated: " + getTimeCreated() + ",");
        if (getAttachmentSet() != nullsb.append("AttachmentSet: " + getAttachmentSet() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getCaseId() == null) ? 0 : getCaseId().hashCode()); 
        hashCode = prime * hashCode + ((getBody() == null) ? 0 : getBody().hashCode()); 
        hashCode = prime * hashCode + ((getSubmittedBy() == null) ? 0 : getSubmittedBy().hashCode()); 
        hashCode = prime * hashCode + ((getTimeCreated() == null) ? 0 : getTimeCreated().hashCode()); 
        hashCode = prime * hashCode + ((getAttachmentSet() == null) ? 0 : getAttachmentSet().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof Communication == falsereturn false;
        Communication other = (Communication)obj;
        
        if (other.getCaseId() == null ^ this.getCaseId() == nullreturn false;
        if (other.getCaseId() != null && other.getCaseId().equals(this.getCaseId()) == falsereturn false
        if (other.getBody() == null ^ this.getBody() == nullreturn false;
        if (other.getBody() != null && other.getBody().equals(this.getBody()) == falsereturn false
        if (other.getSubmittedBy() == null ^ this.getSubmittedBy() == nullreturn false;
        if (other.getSubmittedBy() != null && other.getSubmittedBy().equals(this.getSubmittedBy()) == falsereturn false
        if (other.getTimeCreated() == null ^ this.getTimeCreated() == nullreturn false;
        if (other.getTimeCreated() != null && other.getTimeCreated().equals(this.getTimeCreated()) == falsereturn false
        if (other.getAttachmentSet() == null ^ this.getAttachmentSet() == nullreturn false;
        if (other.getAttachmentSet() != null && other.getAttachmentSet().equals(this.getAttachmentSet()) == falsereturn false
        return true;
    }
    
    @Override
    public Communication clone() {
        try {
            return (Communicationsuper.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