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

Describes an instance event.

 
 public class InstanceStatusEvent implements SerializableCloneable {

    
The associated code of the event.

Constraints:
Allowed Values: instance-reboot, system-reboot, system-maintenance, instance-retirement, instance-stop

 
     private String code;

    
A description of the event.
 
     private String description;

    
The earliest scheduled start time for the event.
 
     private java.util.Date notBefore;

    
The latest scheduled end time for the event.
 
     private java.util.Date notAfter;

    
The associated code of the event.

Constraints:
Allowed Values: instance-reboot, system-reboot, system-maintenance, instance-retirement, instance-stop

Returns:
The associated code of the event.
See also:
EventCode
 
     public String getCode() {
         return ;
     }
    
    
The associated code of the event.

Constraints:
Allowed Values: instance-reboot, system-reboot, system-maintenance, instance-retirement, instance-stop

Parameters:
code The associated code of the event.
See also:
EventCode
 
     public void setCode(String code) {
         this. = code;
     }
    
    
The associated code of the event.

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

Constraints:
Allowed Values: instance-reboot, system-reboot, system-maintenance, instance-retirement, instance-stop

Parameters:
code The associated code of the event.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
EventCode
 
     public InstanceStatusEvent withCode(String code) {
         this. = code;
         return this;
     }

    
The associated code of the event.

Constraints:
Allowed Values: instance-reboot, system-reboot, system-maintenance, instance-retirement, instance-stop

Parameters:
code The associated code of the event.
See also:
EventCode
    public void setCode(EventCode code) {
        this. = code.toString();
    }
    
    
The associated code of the event.

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

Constraints:
Allowed Values: instance-reboot, system-reboot, system-maintenance, instance-retirement, instance-stop

Parameters:
code The associated code of the event.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
EventCode
    public InstanceStatusEvent withCode(EventCode code) {
        this. = code.toString();
        return this;
    }

    
A description of the event.

Returns:
A description of the event.
    public String getDescription() {
        return ;
    }
    
    
A description of the event.

Parameters:
description A description of the event.
    public void setDescription(String description) {
        this. = description;
    }
    
    
A description of the event.

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

Parameters:
description A description of the event.
Returns:
A reference to this updated object so that method calls can be chained together.
    public InstanceStatusEvent withDescription(String description) {
        this. = description;
        return this;
    }

    
The earliest scheduled start time for the event.

Returns:
The earliest scheduled start time for the event.
    public java.util.Date getNotBefore() {
        return ;
    }
    
    
The earliest scheduled start time for the event.

Parameters:
notBefore The earliest scheduled start time for the event.
    public void setNotBefore(java.util.Date notBefore) {
        this. = notBefore;
    }
    
    
The earliest scheduled start time for the event.

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

Parameters:
notBefore The earliest scheduled start time for the event.
Returns:
A reference to this updated object so that method calls can be chained together.
    public InstanceStatusEvent withNotBefore(java.util.Date notBefore) {
        this. = notBefore;
        return this;
    }

    
The latest scheduled end time for the event.

Returns:
The latest scheduled end time for the event.
    public java.util.Date getNotAfter() {
        return ;
    }
    
    
The latest scheduled end time for the event.

Parameters:
notAfter The latest scheduled end time for the event.
    public void setNotAfter(java.util.Date notAfter) {
        this. = notAfter;
    }
    
    
The latest scheduled end time for the event.

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

Parameters:
notAfter The latest scheduled end time for the event.
Returns:
A reference to this updated object so that method calls can be chained together.
    public InstanceStatusEvent withNotAfter(java.util.Date notAfter) {
        this. = notAfter;
        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 (getDescription() != nullsb.append("Description: " + getDescription() + ",");
        if (getNotBefore() != nullsb.append("NotBefore: " + getNotBefore() + ",");
        if (getNotAfter() != nullsb.append("NotAfter: " + getNotAfter() );
        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 + ((getDescription() == null) ? 0 : getDescription().hashCode()); 
        hashCode = prime * hashCode + ((getNotBefore() == null) ? 0 : getNotBefore().hashCode()); 
        hashCode = prime * hashCode + ((getNotAfter() == null) ? 0 : getNotAfter().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof InstanceStatusEvent == falsereturn false;
        InstanceStatusEvent other = (InstanceStatusEvent)obj;
        
        if (other.getCode() == null ^ this.getCode() == nullreturn false;
        if (other.getCode() != null && other.getCode().equals(this.getCode()) == falsereturn false
        if (other.getDescription() == null ^ this.getDescription() == nullreturn false;
        if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == falsereturn false
        if (other.getNotBefore() == null ^ this.getNotBefore() == nullreturn false;
        if (other.getNotBefore() != null && other.getNotBefore().equals(this.getNotBefore()) == falsereturn false
        if (other.getNotAfter() == null ^ this.getNotAfter() == nullreturn false;
        if (other.getNotAfter() != null && other.getNotAfter().equals(this.getNotAfter()) == falsereturn false
        return true;
    }
    
    @Override
    public InstanceStatusEvent clone() {
        try {
            return (InstanceStatusEventsuper.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