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

This data type is used as a response element in the DescribeEvents action.

 
 public class Event implements SerializableCloneable {

    
Provides the identifier for the source of the event.
 
     private String sourceIdentifier;

    
Specifies the source type for this event.

Constraints:
Allowed Values: db-instance, db-parameter-group, db-security-group, db-snapshot

 
     private String sourceType;

    
Provides the text of this event.
 
     private String message;

    
Specifies the category for the event.
 
Specifies the date and time of the event.
 
     private java.util.Date date;

    
Default constructor for a new Event object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.
 
     public Event() {}
    
    
Provides the identifier for the source of the event.

Returns:
Provides the identifier for the source of the event.
 
     public String getSourceIdentifier() {
         return ;
     }
    
    
Provides the identifier for the source of the event.

Parameters:
sourceIdentifier Provides the identifier for the source of the event.
 
     public void setSourceIdentifier(String sourceIdentifier) {
         this. = sourceIdentifier;
     }
    
    
Provides the identifier for the source of the event.

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

Parameters:
sourceIdentifier Provides the identifier for the source of the event.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public Event withSourceIdentifier(String sourceIdentifier) {
         this. = sourceIdentifier;
         return this;
     }

    
Specifies the source type for this event.

Constraints:
Allowed Values: db-instance, db-parameter-group, db-security-group, db-snapshot

Returns:
Specifies the source type for this event.
See also:
SourceType
    public String getSourceType() {
        return ;
    }
    
    
Specifies the source type for this event.

Constraints:
Allowed Values: db-instance, db-parameter-group, db-security-group, db-snapshot

Parameters:
sourceType Specifies the source type for this event.
See also:
SourceType
    public void setSourceType(String sourceType) {
        this. = sourceType;
    }
    
    
Specifies the source type for this event.

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

Constraints:
Allowed Values: db-instance, db-parameter-group, db-security-group, db-snapshot

Parameters:
sourceType Specifies the source type for this event.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
SourceType
    public Event withSourceType(String sourceType) {
        this. = sourceType;
        return this;
    }

    
Specifies the source type for this event.

Constraints:
Allowed Values: db-instance, db-parameter-group, db-security-group, db-snapshot

Parameters:
sourceType Specifies the source type for this event.
See also:
SourceType
    public void setSourceType(SourceType sourceType) {
        this. = sourceType.toString();
    }
    
    
Specifies the source type for this event.

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

Constraints:
Allowed Values: db-instance, db-parameter-group, db-security-group, db-snapshot

Parameters:
sourceType Specifies the source type for this event.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
SourceType
    public Event withSourceType(SourceType sourceType) {
        this. = sourceType.toString();
        return this;
    }

    
Provides the text of this event.

Returns:
Provides the text of this event.
    public String getMessage() {
        return ;
    }
    
    
Provides the text of this event.

Parameters:
message Provides the text of this event.
    public void setMessage(String message) {
        this. = message;
    }
    
    
Provides the text of this event.

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

Parameters:
message Provides the text of this event.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Event withMessage(String message) {
        this. = message;
        return this;
    }

    
Specifies the category for the event.

Returns:
Specifies the category for the event.
    public java.util.List<StringgetEventCategories() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
Specifies the category for the event.

Parameters:
eventCategories Specifies the category for the event.
    public void setEventCategories(java.util.Collection<StringeventCategories) {
        if (eventCategories == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<StringeventCategoriesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(eventCategories.size());
        eventCategoriesCopy.addAll(eventCategories);
        this. = eventCategoriesCopy;
    }
    
    
Specifies the category for the event.

NOTE: This method appends the values to the existing list (if any). Use setEventCategories(java.util.Collection) or withEventCategories(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:
eventCategories Specifies the category for the event.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Event withEventCategories(String... eventCategories) {
        if (getEventCategories() == nullsetEventCategories(new java.util.ArrayList<String>(eventCategories.length));
        for (String value : eventCategories) {
            getEventCategories().add(value);
        }
        return this;
    }
    
    
Specifies the category for the event.

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

Parameters:
eventCategories Specifies the category for the event.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Event withEventCategories(java.util.Collection<StringeventCategories) {
        if (eventCategories == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringeventCategoriesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(eventCategories.size());
            eventCategoriesCopy.addAll(eventCategories);
            this. = eventCategoriesCopy;
        }
        return this;
    }

    
Specifies the date and time of the event.

Returns:
Specifies the date and time of the event.
    public java.util.Date getDate() {
        return ;
    }
    
    
Specifies the date and time of the event.

Parameters:
date Specifies the date and time of the event.
    public void setDate(java.util.Date date) {
        this. = date;
    }
    
    
Specifies the date and time of the event.

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

Parameters:
date Specifies the date and time of the event.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Event withDate(java.util.Date date) {
        this. = date;
        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 (getSourceIdentifier() != nullsb.append("SourceIdentifier: " + getSourceIdentifier() + ",");
        if (getSourceType() != nullsb.append("SourceType: " + getSourceType() + ",");
        if (getMessage() != nullsb.append("Message: " + getMessage() + ",");
        if (getEventCategories() != nullsb.append("EventCategories: " + getEventCategories() + ",");
        if (getDate() != nullsb.append("Date: " + getDate() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getSourceIdentifier() == null) ? 0 : getSourceIdentifier().hashCode()); 
        hashCode = prime * hashCode + ((getSourceType() == null) ? 0 : getSourceType().hashCode()); 
        hashCode = prime * hashCode + ((getMessage() == null) ? 0 : getMessage().hashCode()); 
        hashCode = prime * hashCode + ((getEventCategories() == null) ? 0 : getEventCategories().hashCode()); 
        hashCode = prime * hashCode + ((getDate() == null) ? 0 : getDate().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof Event == falsereturn false;
        Event other = (Event)obj;
        
        if (other.getSourceIdentifier() == null ^ this.getSourceIdentifier() == nullreturn false;
        if (other.getSourceIdentifier() != null && other.getSourceIdentifier().equals(this.getSourceIdentifier()) == falsereturn false
        if (other.getSourceType() == null ^ this.getSourceType() == nullreturn false;
        if (other.getSourceType() != null && other.getSourceType().equals(this.getSourceType()) == falsereturn false
        if (other.getMessage() == null ^ this.getMessage() == nullreturn false;
        if (other.getMessage() != null && other.getMessage().equals(this.getMessage()) == falsereturn false
        if (other.getEventCategories() == null ^ this.getEventCategories() == nullreturn false;
        if (other.getEventCategories() != null && other.getEventCategories().equals(this.getEventCategories()) == falsereturn false
        if (other.getDate() == null ^ this.getDate() == nullreturn false;
        if (other.getDate() != null && other.getDate().equals(this.getDate()) == falsereturn false
        return true;
    }
    
    @Override
    public Event clone() {
        try {
            return (Eventsuper.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