/* * Copyright 2018-2023 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.backupgateway.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Describes a bandwidth rate limit interval for a gateway. A bandwidth rate limit schedule consists of one or more * bandwidth rate limit intervals. A bandwidth rate limit interval defines a period of time on one or more days of the * week, during which bandwidth rate limits are specified for uploading, downloading, or both. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class BandwidthRateLimitInterval implements Serializable, Cloneable, StructuredPojo { /** ** The average upload rate limit component of the bandwidth rate limit interval, in bits per second. This field does * not appear in the response if the upload rate limit is not set. *
*
* For Backup Gateway, the minimum value is (Value)
.
*
* The days of the week component of the bandwidth rate limit interval, represented as ordinal numbers from 0 to 6, * where 0 represents Sunday and 6 represents Saturday. *
*/ private java.util.List* The hour of the day to end the bandwidth rate limit interval. *
*/ private Integer endHourOfDay; /** ** The minute of the hour to end the bandwidth rate limit interval. *
*
* The bandwidth rate limit interval ends at the end of the minute. To end an interval at the end of an hour, use
* the value 59
.
*
* The hour of the day to start the bandwidth rate limit interval. *
*/ private Integer startHourOfDay; /** *
* The minute of the hour to start the bandwidth rate limit interval. The interval begins at the start of that
* minute. To begin an interval exactly at the start of the hour, use the value 0
.
*
* The average upload rate limit component of the bandwidth rate limit interval, in bits per second. This field does * not appear in the response if the upload rate limit is not set. *
*
* For Backup Gateway, the minimum value is (Value)
.
*
* For Backup Gateway, the minimum value is (Value)
.
*
* The average upload rate limit component of the bandwidth rate limit interval, in bits per second. This field does * not appear in the response if the upload rate limit is not set. *
*
* For Backup Gateway, the minimum value is (Value)
.
*
* For Backup Gateway, the minimum value is (Value)
.
*
* The average upload rate limit component of the bandwidth rate limit interval, in bits per second. This field does * not appear in the response if the upload rate limit is not set. *
*
* For Backup Gateway, the minimum value is (Value)
.
*
* For Backup Gateway, the minimum value is (Value)
.
*
* The days of the week component of the bandwidth rate limit interval, represented as ordinal numbers from 0 to 6, * where 0 represents Sunday and 6 represents Saturday. *
* * @return The days of the week component of the bandwidth rate limit interval, represented as ordinal numbers from * 0 to 6, where 0 represents Sunday and 6 represents Saturday. */ public java.util.List* The days of the week component of the bandwidth rate limit interval, represented as ordinal numbers from 0 to 6, * where 0 represents Sunday and 6 represents Saturday. *
* * @param daysOfWeek * The days of the week component of the bandwidth rate limit interval, represented as ordinal numbers from 0 * to 6, where 0 represents Sunday and 6 represents Saturday. */ public void setDaysOfWeek(java.util.Collection* The days of the week component of the bandwidth rate limit interval, represented as ordinal numbers from 0 to 6, * where 0 represents Sunday and 6 represents Saturday. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setDaysOfWeek(java.util.Collection)} or {@link #withDaysOfWeek(java.util.Collection)} if you want to * override the existing values. *
* * @param daysOfWeek * The days of the week component of the bandwidth rate limit interval, represented as ordinal numbers from 0 * to 6, where 0 represents Sunday and 6 represents Saturday. * @return Returns a reference to this object so that method calls can be chained together. */ public BandwidthRateLimitInterval withDaysOfWeek(Integer... daysOfWeek) { if (this.daysOfWeek == null) { setDaysOfWeek(new java.util.ArrayList* The days of the week component of the bandwidth rate limit interval, represented as ordinal numbers from 0 to 6, * where 0 represents Sunday and 6 represents Saturday. *
* * @param daysOfWeek * The days of the week component of the bandwidth rate limit interval, represented as ordinal numbers from 0 * to 6, where 0 represents Sunday and 6 represents Saturday. * @return Returns a reference to this object so that method calls can be chained together. */ public BandwidthRateLimitInterval withDaysOfWeek(java.util.Collection* The hour of the day to end the bandwidth rate limit interval. *
* * @param endHourOfDay * The hour of the day to end the bandwidth rate limit interval. */ public void setEndHourOfDay(Integer endHourOfDay) { this.endHourOfDay = endHourOfDay; } /** ** The hour of the day to end the bandwidth rate limit interval. *
* * @return The hour of the day to end the bandwidth rate limit interval. */ public Integer getEndHourOfDay() { return this.endHourOfDay; } /** ** The hour of the day to end the bandwidth rate limit interval. *
* * @param endHourOfDay * The hour of the day to end the bandwidth rate limit interval. * @return Returns a reference to this object so that method calls can be chained together. */ public BandwidthRateLimitInterval withEndHourOfDay(Integer endHourOfDay) { setEndHourOfDay(endHourOfDay); return this; } /** ** The minute of the hour to end the bandwidth rate limit interval. *
*
* The bandwidth rate limit interval ends at the end of the minute. To end an interval at the end of an hour, use
* the value 59
.
*
* The bandwidth rate limit interval ends at the end of the minute. To end an interval at the end of an hour,
* use the value 59
.
*
* The minute of the hour to end the bandwidth rate limit interval. *
*
* The bandwidth rate limit interval ends at the end of the minute. To end an interval at the end of an hour, use
* the value 59
.
*
* The bandwidth rate limit interval ends at the end of the minute. To end an interval at the end of an
* hour, use the value 59
.
*
* The minute of the hour to end the bandwidth rate limit interval. *
*
* The bandwidth rate limit interval ends at the end of the minute. To end an interval at the end of an hour, use
* the value 59
.
*
* The bandwidth rate limit interval ends at the end of the minute. To end an interval at the end of an hour,
* use the value 59
.
*
* The hour of the day to start the bandwidth rate limit interval. *
* * @param startHourOfDay * The hour of the day to start the bandwidth rate limit interval. */ public void setStartHourOfDay(Integer startHourOfDay) { this.startHourOfDay = startHourOfDay; } /** ** The hour of the day to start the bandwidth rate limit interval. *
* * @return The hour of the day to start the bandwidth rate limit interval. */ public Integer getStartHourOfDay() { return this.startHourOfDay; } /** ** The hour of the day to start the bandwidth rate limit interval. *
* * @param startHourOfDay * The hour of the day to start the bandwidth rate limit interval. * @return Returns a reference to this object so that method calls can be chained together. */ public BandwidthRateLimitInterval withStartHourOfDay(Integer startHourOfDay) { setStartHourOfDay(startHourOfDay); return this; } /** *
* The minute of the hour to start the bandwidth rate limit interval. The interval begins at the start of that
* minute. To begin an interval exactly at the start of the hour, use the value 0
.
*
0
.
*/
public void setStartMinuteOfHour(Integer startMinuteOfHour) {
this.startMinuteOfHour = startMinuteOfHour;
}
/**
*
* The minute of the hour to start the bandwidth rate limit interval. The interval begins at the start of that
* minute. To begin an interval exactly at the start of the hour, use the value 0
.
*
0
.
*/
public Integer getStartMinuteOfHour() {
return this.startMinuteOfHour;
}
/**
*
* The minute of the hour to start the bandwidth rate limit interval. The interval begins at the start of that
* minute. To begin an interval exactly at the start of the hour, use the value 0
.
*
0
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BandwidthRateLimitInterval withStartMinuteOfHour(Integer startMinuteOfHour) {
setStartMinuteOfHour(startMinuteOfHour);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getAverageUploadRateLimitInBitsPerSec() != null)
sb.append("AverageUploadRateLimitInBitsPerSec: ").append(getAverageUploadRateLimitInBitsPerSec()).append(",");
if (getDaysOfWeek() != null)
sb.append("DaysOfWeek: ").append(getDaysOfWeek()).append(",");
if (getEndHourOfDay() != null)
sb.append("EndHourOfDay: ").append(getEndHourOfDay()).append(",");
if (getEndMinuteOfHour() != null)
sb.append("EndMinuteOfHour: ").append(getEndMinuteOfHour()).append(",");
if (getStartHourOfDay() != null)
sb.append("StartHourOfDay: ").append(getStartHourOfDay()).append(",");
if (getStartMinuteOfHour() != null)
sb.append("StartMinuteOfHour: ").append(getStartMinuteOfHour());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof BandwidthRateLimitInterval == false)
return false;
BandwidthRateLimitInterval other = (BandwidthRateLimitInterval) obj;
if (other.getAverageUploadRateLimitInBitsPerSec() == null ^ this.getAverageUploadRateLimitInBitsPerSec() == null)
return false;
if (other.getAverageUploadRateLimitInBitsPerSec() != null
&& other.getAverageUploadRateLimitInBitsPerSec().equals(this.getAverageUploadRateLimitInBitsPerSec()) == false)
return false;
if (other.getDaysOfWeek() == null ^ this.getDaysOfWeek() == null)
return false;
if (other.getDaysOfWeek() != null && other.getDaysOfWeek().equals(this.getDaysOfWeek()) == false)
return false;
if (other.getEndHourOfDay() == null ^ this.getEndHourOfDay() == null)
return false;
if (other.getEndHourOfDay() != null && other.getEndHourOfDay().equals(this.getEndHourOfDay()) == false)
return false;
if (other.getEndMinuteOfHour() == null ^ this.getEndMinuteOfHour() == null)
return false;
if (other.getEndMinuteOfHour() != null && other.getEndMinuteOfHour().equals(this.getEndMinuteOfHour()) == false)
return false;
if (other.getStartHourOfDay() == null ^ this.getStartHourOfDay() == null)
return false;
if (other.getStartHourOfDay() != null && other.getStartHourOfDay().equals(this.getStartHourOfDay()) == false)
return false;
if (other.getStartMinuteOfHour() == null ^ this.getStartMinuteOfHour() == null)
return false;
if (other.getStartMinuteOfHour() != null && other.getStartMinuteOfHour().equals(this.getStartMinuteOfHour()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAverageUploadRateLimitInBitsPerSec() == null) ? 0 : getAverageUploadRateLimitInBitsPerSec().hashCode());
hashCode = prime * hashCode + ((getDaysOfWeek() == null) ? 0 : getDaysOfWeek().hashCode());
hashCode = prime * hashCode + ((getEndHourOfDay() == null) ? 0 : getEndHourOfDay().hashCode());
hashCode = prime * hashCode + ((getEndMinuteOfHour() == null) ? 0 : getEndMinuteOfHour().hashCode());
hashCode = prime * hashCode + ((getStartHourOfDay() == null) ? 0 : getStartHourOfDay().hashCode());
hashCode = prime * hashCode + ((getStartMinuteOfHour() == null) ? 0 : getStartMinuteOfHour().hashCode());
return hashCode;
}
@Override
public BandwidthRateLimitInterval clone() {
try {
return (BandwidthRateLimitInterval) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.backupgateway.model.transform.BandwidthRateLimitIntervalMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}