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

Represents a single occurrence of something interesting within the system. Some examples of events are creating a cache cluster, adding or removing a cache node, or rebooting a node.

 
 public class Event implements SerializableCloneable {

    
The identifier for the source of the event. For example, if the event occurred at the cache cluster level, the identifier would be the name of the cache cluster.
 
     private String sourceIdentifier;

    
Specifies the origin of this event - a cache cluster, a parameter group, a security group, etc.

Constraints:
Allowed Values: cache-cluster, cache-parameter-group, cache-security-group, cache-subnet-group

 
     private String sourceType;

    
The text of the event.
 
     private String message;

    
The date and time when the event occurred.
 
     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() {}
    
    
The identifier for the source of the event. For example, if the event occurred at the cache cluster level, the identifier would be the name of the cache cluster.

Returns:
The identifier for the source of the event. For example, if the event occurred at the cache cluster level, the identifier would be the name of the cache cluster.
 
     public String getSourceIdentifier() {
         return ;
     }
    
    
The identifier for the source of the event. For example, if the event occurred at the cache cluster level, the identifier would be the name of the cache cluster.

Parameters:
sourceIdentifier The identifier for the source of the event. For example, if the event occurred at the cache cluster level, the identifier would be the name of the cache cluster.
 
     public void setSourceIdentifier(String sourceIdentifier) {
         this. = sourceIdentifier;
     }
    
    
The identifier for the source of the event. For example, if the event occurred at the cache cluster level, the identifier would be the name of the cache cluster.

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

Parameters:
sourceIdentifier The identifier for the source of the event. For example, if the event occurred at the cache cluster level, the identifier would be the name of the cache cluster.
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 origin of this event - a cache cluster, a parameter group, a security group, etc.

Constraints:
Allowed Values: cache-cluster, cache-parameter-group, cache-security-group, cache-subnet-group

Returns:
Specifies the origin of this event - a cache cluster, a parameter group, a security group, etc.
See also:
SourceType
    public String getSourceType() {
        return ;
    }
    
    
Specifies the origin of this event - a cache cluster, a parameter group, a security group, etc.

Constraints:
Allowed Values: cache-cluster, cache-parameter-group, cache-security-group, cache-subnet-group

Parameters:
sourceType Specifies the origin of this event - a cache cluster, a parameter group, a security group, etc.
See also:
SourceType
    public void setSourceType(String sourceType) {
        this. = sourceType;
    }
    
    
Specifies the origin of this event - a cache cluster, a parameter group, a security group, etc.

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

Constraints:
Allowed Values: cache-cluster, cache-parameter-group, cache-security-group, cache-subnet-group

Parameters:
sourceType Specifies the origin of this event - a cache cluster, a parameter group, a security group, etc.
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 origin of this event - a cache cluster, a parameter group, a security group, etc.

Constraints:
Allowed Values: cache-cluster, cache-parameter-group, cache-security-group, cache-subnet-group

Parameters:
sourceType Specifies the origin of this event - a cache cluster, a parameter group, a security group, etc.
See also:
SourceType
    public void setSourceType(SourceType sourceType) {
        this. = sourceType.toString();
    }
    
    
Specifies the origin of this event - a cache cluster, a parameter group, a security group, etc.

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

Constraints:
Allowed Values: cache-cluster, cache-parameter-group, cache-security-group, cache-subnet-group

Parameters:
sourceType Specifies the origin of this event - a cache cluster, a parameter group, a security group, etc.
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;
    }

    
The text of the event.

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

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

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

Parameters:
message The text of the 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;
    }

    
The date and time when the event occurred.

Returns:
The date and time when the event occurred.
    public java.util.Date getDate() {
        return ;
    }
    
    
The date and time when the event occurred.

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

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

Parameters:
date The date and time when the event occurred.
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 (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 + ((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.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