All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.opsworks.model.WeeklyAutoScalingSchedule Maven / Gradle / Ivy

Go to download

The AWS SDK for Java with support for OSGi. The AWS SDK for Java provides Java APIs for building software on AWS' cost-effective, scalable, and reliable infrastructure products. The AWS Java SDK allows developers to code against APIs for all of Amazon's infrastructure web services (Amazon S3, Amazon EC2, Amazon SQS, Amazon Relational Database Service, Amazon AutoScaling, etc).

There is a newer version: 1.11.60
Show newest version
/*
 * Copyright 2011-2016 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.opsworks.model;

import java.io.Serializable;

/**
 * 

* Describes a time-based instance's auto scaling schedule. The schedule * consists of a set of key-value pairs. *

*
    *
  • *

    * The key is the time period (a UTC hour) and must be an integer from 0 - 23. *

    *
  • *
  • *

    * The value indicates whether the instance should be online or offline for the * specified period, and must be set to "on" or "off" *

    *
  • *
*

* The default setting for all time periods is off, so you use the following * parameters primarily to specify the online periods. You don't have to * explicitly specify offline periods unless you want to change an online period * to an offline period. *

*

* The following example specifies that the instance should be online for four * hours, from UTC 1200 - 1600. It will be off for the remainder of the day. *

*

* { "12":"on", "13":"on", "14":"on", "15":"on" } *

*/ public class WeeklyAutoScalingSchedule implements Serializable, Cloneable { /** *

* The schedule for Monday. *

*/ private com.amazonaws.internal.SdkInternalMap monday; /** *

* The schedule for Tuesday. *

*/ private com.amazonaws.internal.SdkInternalMap tuesday; /** *

* The schedule for Wednesday. *

*/ private com.amazonaws.internal.SdkInternalMap wednesday; /** *

* The schedule for Thursday. *

*/ private com.amazonaws.internal.SdkInternalMap thursday; /** *

* The schedule for Friday. *

*/ private com.amazonaws.internal.SdkInternalMap friday; /** *

* The schedule for Saturday. *

*/ private com.amazonaws.internal.SdkInternalMap saturday; /** *

* The schedule for Sunday. *

*/ private com.amazonaws.internal.SdkInternalMap sunday; /** *

* The schedule for Monday. *

* * @return The schedule for Monday. */ public java.util.Map getMonday() { if (monday == null) { monday = new com.amazonaws.internal.SdkInternalMap(); } return monday; } /** *

* The schedule for Monday. *

* * @param monday * The schedule for Monday. */ public void setMonday(java.util.Map monday) { this.monday = monday == null ? null : new com.amazonaws.internal.SdkInternalMap( monday); } /** *

* The schedule for Monday. *

* * @param monday * The schedule for Monday. * @return Returns a reference to this object so that method calls can be * chained together. */ public WeeklyAutoScalingSchedule withMonday( java.util.Map monday) { setMonday(monday); return this; } public WeeklyAutoScalingSchedule addMondayEntry(String key, String value) { if (null == this.monday) { this.monday = new com.amazonaws.internal.SdkInternalMap(); } if (this.monday.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.monday.put(key, value); return this; } /** * Removes all the entries added into Monday. <p> Returns a reference to * this object so that method calls can be chained together. */ public WeeklyAutoScalingSchedule clearMondayEntries() { this.monday = null; return this; } /** *

* The schedule for Tuesday. *

* * @return The schedule for Tuesday. */ public java.util.Map getTuesday() { if (tuesday == null) { tuesday = new com.amazonaws.internal.SdkInternalMap(); } return tuesday; } /** *

* The schedule for Tuesday. *

* * @param tuesday * The schedule for Tuesday. */ public void setTuesday(java.util.Map tuesday) { this.tuesday = tuesday == null ? null : new com.amazonaws.internal.SdkInternalMap( tuesday); } /** *

* The schedule for Tuesday. *

* * @param tuesday * The schedule for Tuesday. * @return Returns a reference to this object so that method calls can be * chained together. */ public WeeklyAutoScalingSchedule withTuesday( java.util.Map tuesday) { setTuesday(tuesday); return this; } public WeeklyAutoScalingSchedule addTuesdayEntry(String key, String value) { if (null == this.tuesday) { this.tuesday = new com.amazonaws.internal.SdkInternalMap(); } if (this.tuesday.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.tuesday.put(key, value); return this; } /** * Removes all the entries added into Tuesday. <p> Returns a reference to * this object so that method calls can be chained together. */ public WeeklyAutoScalingSchedule clearTuesdayEntries() { this.tuesday = null; return this; } /** *

* The schedule for Wednesday. *

* * @return The schedule for Wednesday. */ public java.util.Map getWednesday() { if (wednesday == null) { wednesday = new com.amazonaws.internal.SdkInternalMap(); } return wednesday; } /** *

* The schedule for Wednesday. *

* * @param wednesday * The schedule for Wednesday. */ public void setWednesday(java.util.Map wednesday) { this.wednesday = wednesday == null ? null : new com.amazonaws.internal.SdkInternalMap( wednesday); } /** *

* The schedule for Wednesday. *

* * @param wednesday * The schedule for Wednesday. * @return Returns a reference to this object so that method calls can be * chained together. */ public WeeklyAutoScalingSchedule withWednesday( java.util.Map wednesday) { setWednesday(wednesday); return this; } public WeeklyAutoScalingSchedule addWednesdayEntry(String key, String value) { if (null == this.wednesday) { this.wednesday = new com.amazonaws.internal.SdkInternalMap(); } if (this.wednesday.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.wednesday.put(key, value); return this; } /** * Removes all the entries added into Wednesday. <p> Returns a reference * to this object so that method calls can be chained together. */ public WeeklyAutoScalingSchedule clearWednesdayEntries() { this.wednesday = null; return this; } /** *

* The schedule for Thursday. *

* * @return The schedule for Thursday. */ public java.util.Map getThursday() { if (thursday == null) { thursday = new com.amazonaws.internal.SdkInternalMap(); } return thursday; } /** *

* The schedule for Thursday. *

* * @param thursday * The schedule for Thursday. */ public void setThursday(java.util.Map thursday) { this.thursday = thursday == null ? null : new com.amazonaws.internal.SdkInternalMap( thursday); } /** *

* The schedule for Thursday. *

* * @param thursday * The schedule for Thursday. * @return Returns a reference to this object so that method calls can be * chained together. */ public WeeklyAutoScalingSchedule withThursday( java.util.Map thursday) { setThursday(thursday); return this; } public WeeklyAutoScalingSchedule addThursdayEntry(String key, String value) { if (null == this.thursday) { this.thursday = new com.amazonaws.internal.SdkInternalMap(); } if (this.thursday.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.thursday.put(key, value); return this; } /** * Removes all the entries added into Thursday. <p> Returns a reference * to this object so that method calls can be chained together. */ public WeeklyAutoScalingSchedule clearThursdayEntries() { this.thursday = null; return this; } /** *

* The schedule for Friday. *

* * @return The schedule for Friday. */ public java.util.Map getFriday() { if (friday == null) { friday = new com.amazonaws.internal.SdkInternalMap(); } return friday; } /** *

* The schedule for Friday. *

* * @param friday * The schedule for Friday. */ public void setFriday(java.util.Map friday) { this.friday = friday == null ? null : new com.amazonaws.internal.SdkInternalMap( friday); } /** *

* The schedule for Friday. *

* * @param friday * The schedule for Friday. * @return Returns a reference to this object so that method calls can be * chained together. */ public WeeklyAutoScalingSchedule withFriday( java.util.Map friday) { setFriday(friday); return this; } public WeeklyAutoScalingSchedule addFridayEntry(String key, String value) { if (null == this.friday) { this.friday = new com.amazonaws.internal.SdkInternalMap(); } if (this.friday.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.friday.put(key, value); return this; } /** * Removes all the entries added into Friday. <p> Returns a reference to * this object so that method calls can be chained together. */ public WeeklyAutoScalingSchedule clearFridayEntries() { this.friday = null; return this; } /** *

* The schedule for Saturday. *

* * @return The schedule for Saturday. */ public java.util.Map getSaturday() { if (saturday == null) { saturday = new com.amazonaws.internal.SdkInternalMap(); } return saturday; } /** *

* The schedule for Saturday. *

* * @param saturday * The schedule for Saturday. */ public void setSaturday(java.util.Map saturday) { this.saturday = saturday == null ? null : new com.amazonaws.internal.SdkInternalMap( saturday); } /** *

* The schedule for Saturday. *

* * @param saturday * The schedule for Saturday. * @return Returns a reference to this object so that method calls can be * chained together. */ public WeeklyAutoScalingSchedule withSaturday( java.util.Map saturday) { setSaturday(saturday); return this; } public WeeklyAutoScalingSchedule addSaturdayEntry(String key, String value) { if (null == this.saturday) { this.saturday = new com.amazonaws.internal.SdkInternalMap(); } if (this.saturday.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.saturday.put(key, value); return this; } /** * Removes all the entries added into Saturday. <p> Returns a reference * to this object so that method calls can be chained together. */ public WeeklyAutoScalingSchedule clearSaturdayEntries() { this.saturday = null; return this; } /** *

* The schedule for Sunday. *

* * @return The schedule for Sunday. */ public java.util.Map getSunday() { if (sunday == null) { sunday = new com.amazonaws.internal.SdkInternalMap(); } return sunday; } /** *

* The schedule for Sunday. *

* * @param sunday * The schedule for Sunday. */ public void setSunday(java.util.Map sunday) { this.sunday = sunday == null ? null : new com.amazonaws.internal.SdkInternalMap( sunday); } /** *

* The schedule for Sunday. *

* * @param sunday * The schedule for Sunday. * @return Returns a reference to this object so that method calls can be * chained together. */ public WeeklyAutoScalingSchedule withSunday( java.util.Map sunday) { setSunday(sunday); return this; } public WeeklyAutoScalingSchedule addSundayEntry(String key, String value) { if (null == this.sunday) { this.sunday = new com.amazonaws.internal.SdkInternalMap(); } if (this.sunday.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.sunday.put(key, value); return this; } /** * Removes all the entries added into Sunday. <p> Returns a reference to * this object so that method calls can be chained together. */ public WeeklyAutoScalingSchedule clearSundayEntries() { this.sunday = null; return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getMonday() != null) sb.append("Monday: " + getMonday() + ","); if (getTuesday() != null) sb.append("Tuesday: " + getTuesday() + ","); if (getWednesday() != null) sb.append("Wednesday: " + getWednesday() + ","); if (getThursday() != null) sb.append("Thursday: " + getThursday() + ","); if (getFriday() != null) sb.append("Friday: " + getFriday() + ","); if (getSaturday() != null) sb.append("Saturday: " + getSaturday() + ","); if (getSunday() != null) sb.append("Sunday: " + getSunday()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof WeeklyAutoScalingSchedule == false) return false; WeeklyAutoScalingSchedule other = (WeeklyAutoScalingSchedule) obj; if (other.getMonday() == null ^ this.getMonday() == null) return false; if (other.getMonday() != null && other.getMonday().equals(this.getMonday()) == false) return false; if (other.getTuesday() == null ^ this.getTuesday() == null) return false; if (other.getTuesday() != null && other.getTuesday().equals(this.getTuesday()) == false) return false; if (other.getWednesday() == null ^ this.getWednesday() == null) return false; if (other.getWednesday() != null && other.getWednesday().equals(this.getWednesday()) == false) return false; if (other.getThursday() == null ^ this.getThursday() == null) return false; if (other.getThursday() != null && other.getThursday().equals(this.getThursday()) == false) return false; if (other.getFriday() == null ^ this.getFriday() == null) return false; if (other.getFriday() != null && other.getFriday().equals(this.getFriday()) == false) return false; if (other.getSaturday() == null ^ this.getSaturday() == null) return false; if (other.getSaturday() != null && other.getSaturday().equals(this.getSaturday()) == false) return false; if (other.getSunday() == null ^ this.getSunday() == null) return false; if (other.getSunday() != null && other.getSunday().equals(this.getSunday()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getMonday() == null) ? 0 : getMonday().hashCode()); hashCode = prime * hashCode + ((getTuesday() == null) ? 0 : getTuesday().hashCode()); hashCode = prime * hashCode + ((getWednesday() == null) ? 0 : getWednesday().hashCode()); hashCode = prime * hashCode + ((getThursday() == null) ? 0 : getThursday().hashCode()); hashCode = prime * hashCode + ((getFriday() == null) ? 0 : getFriday().hashCode()); hashCode = prime * hashCode + ((getSaturday() == null) ? 0 : getSaturday().hashCode()); hashCode = prime * hashCode + ((getSunday() == null) ? 0 : getSunday().hashCode()); return hashCode; } @Override public WeeklyAutoScalingSchedule clone() { try { return (WeeklyAutoScalingSchedule) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException( "Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy