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

software.amazon.awssdk.services.mq.model.WeeklyStartTime Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AmazonMQ module holds the client classes that are used for communicating with AmazonMQ Service

There is a newer version: 2.29.15
Show newest version
/*
 * Copyright 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 software.amazon.awssdk.services.mq.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* The scheduled time period relative to UTC during which Amazon MQ begins to apply pending updates or patches to the * broker. *

*/ @Generated("software.amazon.awssdk:codegen") public final class WeeklyStartTime implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField DAY_OF_WEEK_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("DayOfWeek").getter(getter(WeeklyStartTime::dayOfWeekAsString)).setter(setter(Builder::dayOfWeek)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("dayOfWeek").build()).build(); private static final SdkField TIME_OF_DAY_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("TimeOfDay").getter(getter(WeeklyStartTime::timeOfDay)).setter(setter(Builder::timeOfDay)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("timeOfDay").build()).build(); private static final SdkField TIME_ZONE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("TimeZone").getter(getter(WeeklyStartTime::timeZone)).setter(setter(Builder::timeZone)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("timeZone").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DAY_OF_WEEK_FIELD, TIME_OF_DAY_FIELD, TIME_ZONE_FIELD)); private static final long serialVersionUID = 1L; private final String dayOfWeek; private final String timeOfDay; private final String timeZone; private WeeklyStartTime(BuilderImpl builder) { this.dayOfWeek = builder.dayOfWeek; this.timeOfDay = builder.timeOfDay; this.timeZone = builder.timeZone; } /** *

* Required. The day of the week. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #dayOfWeek} will * return {@link DayOfWeek#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #dayOfWeekAsString}. *

* * @return Required. The day of the week. * @see DayOfWeek */ public final DayOfWeek dayOfWeek() { return DayOfWeek.fromValue(dayOfWeek); } /** *

* Required. The day of the week. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #dayOfWeek} will * return {@link DayOfWeek#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #dayOfWeekAsString}. *

* * @return Required. The day of the week. * @see DayOfWeek */ public final String dayOfWeekAsString() { return dayOfWeek; } /** *

* Required. The time, in 24-hour format. *

* * @return Required. The time, in 24-hour format. */ public final String timeOfDay() { return timeOfDay; } /** *

* The time zone, UTC by default, in either the Country/City format, or the UTC offset format. *

* * @return The time zone, UTC by default, in either the Country/City format, or the UTC offset format. */ public final String timeZone() { return timeZone; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(dayOfWeekAsString()); hashCode = 31 * hashCode + Objects.hashCode(timeOfDay()); hashCode = 31 * hashCode + Objects.hashCode(timeZone()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof WeeklyStartTime)) { return false; } WeeklyStartTime other = (WeeklyStartTime) obj; return Objects.equals(dayOfWeekAsString(), other.dayOfWeekAsString()) && Objects.equals(timeOfDay(), other.timeOfDay()) && Objects.equals(timeZone(), other.timeZone()); } /** * 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. */ @Override public final String toString() { return ToString.builder("WeeklyStartTime").add("DayOfWeek", dayOfWeekAsString()).add("TimeOfDay", timeOfDay()) .add("TimeZone", timeZone()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "DayOfWeek": return Optional.ofNullable(clazz.cast(dayOfWeekAsString())); case "TimeOfDay": return Optional.ofNullable(clazz.cast(timeOfDay())); case "TimeZone": return Optional.ofNullable(clazz.cast(timeZone())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((WeeklyStartTime) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* Required. The day of the week. *

* * @param dayOfWeek * Required. The day of the week. * @see DayOfWeek * @return Returns a reference to this object so that method calls can be chained together. * @see DayOfWeek */ Builder dayOfWeek(String dayOfWeek); /** *

* Required. The day of the week. *

* * @param dayOfWeek * Required. The day of the week. * @see DayOfWeek * @return Returns a reference to this object so that method calls can be chained together. * @see DayOfWeek */ Builder dayOfWeek(DayOfWeek dayOfWeek); /** *

* Required. The time, in 24-hour format. *

* * @param timeOfDay * Required. The time, in 24-hour format. * @return Returns a reference to this object so that method calls can be chained together. */ Builder timeOfDay(String timeOfDay); /** *

* The time zone, UTC by default, in either the Country/City format, or the UTC offset format. *

* * @param timeZone * The time zone, UTC by default, in either the Country/City format, or the UTC offset format. * @return Returns a reference to this object so that method calls can be chained together. */ Builder timeZone(String timeZone); } static final class BuilderImpl implements Builder { private String dayOfWeek; private String timeOfDay; private String timeZone; private BuilderImpl() { } private BuilderImpl(WeeklyStartTime model) { dayOfWeek(model.dayOfWeek); timeOfDay(model.timeOfDay); timeZone(model.timeZone); } public final String getDayOfWeek() { return dayOfWeek; } public final void setDayOfWeek(String dayOfWeek) { this.dayOfWeek = dayOfWeek; } @Override public final Builder dayOfWeek(String dayOfWeek) { this.dayOfWeek = dayOfWeek; return this; } @Override public final Builder dayOfWeek(DayOfWeek dayOfWeek) { this.dayOfWeek(dayOfWeek == null ? null : dayOfWeek.toString()); return this; } public final String getTimeOfDay() { return timeOfDay; } public final void setTimeOfDay(String timeOfDay) { this.timeOfDay = timeOfDay; } @Override public final Builder timeOfDay(String timeOfDay) { this.timeOfDay = timeOfDay; return this; } public final String getTimeZone() { return timeZone; } public final void setTimeZone(String timeZone) { this.timeZone = timeZone; } @Override public final Builder timeZone(String timeZone) { this.timeZone = timeZone; return this; } @Override public WeeklyStartTime build() { return new WeeklyStartTime(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy