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

software.amazon.awssdk.services.connect.model.HoursOfOperationConfig Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Connect module holds the client classes that are used for communicating with Connect.

There is a newer version: 2.29.39
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.connect.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.Consumer;
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;

/**
 * 

* Contains information about the hours of operation. *

*/ @Generated("software.amazon.awssdk:codegen") public final class HoursOfOperationConfig implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField DAY_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Day") .getter(getter(HoursOfOperationConfig::dayAsString)).setter(setter(Builder::day)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Day").build()).build(); private static final SdkField START_TIME_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("StartTime") .getter(getter(HoursOfOperationConfig::startTime)).setter(setter(Builder::startTime)) .constructor(HoursOfOperationTimeSlice::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StartTime").build()).build(); private static final SdkField END_TIME_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("EndTime") .getter(getter(HoursOfOperationConfig::endTime)).setter(setter(Builder::endTime)) .constructor(HoursOfOperationTimeSlice::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EndTime").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DAY_FIELD, START_TIME_FIELD, END_TIME_FIELD)); private static final long serialVersionUID = 1L; private final String day; private final HoursOfOperationTimeSlice startTime; private final HoursOfOperationTimeSlice endTime; private HoursOfOperationConfig(BuilderImpl builder) { this.day = builder.day; this.startTime = builder.startTime; this.endTime = builder.endTime; } /** *

* The day that the hours of operation applies to. *

*

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

* * @return The day that the hours of operation applies to. * @see HoursOfOperationDays */ public final HoursOfOperationDays day() { return HoursOfOperationDays.fromValue(day); } /** *

* The day that the hours of operation applies to. *

*

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

* * @return The day that the hours of operation applies to. * @see HoursOfOperationDays */ public final String dayAsString() { return day; } /** *

* The start time that your contact center opens. *

* * @return The start time that your contact center opens. */ public final HoursOfOperationTimeSlice startTime() { return startTime; } /** *

* The end time that your contact center closes. *

* * @return The end time that your contact center closes. */ public final HoursOfOperationTimeSlice endTime() { return endTime; } @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(dayAsString()); hashCode = 31 * hashCode + Objects.hashCode(startTime()); hashCode = 31 * hashCode + Objects.hashCode(endTime()); 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 HoursOfOperationConfig)) { return false; } HoursOfOperationConfig other = (HoursOfOperationConfig) obj; return Objects.equals(dayAsString(), other.dayAsString()) && Objects.equals(startTime(), other.startTime()) && Objects.equals(endTime(), other.endTime()); } /** * 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("HoursOfOperationConfig").add("Day", dayAsString()).add("StartTime", startTime()) .add("EndTime", endTime()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Day": return Optional.ofNullable(clazz.cast(dayAsString())); case "StartTime": return Optional.ofNullable(clazz.cast(startTime())); case "EndTime": return Optional.ofNullable(clazz.cast(endTime())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((HoursOfOperationConfig) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The day that the hours of operation applies to. *

* * @param day * The day that the hours of operation applies to. * @see HoursOfOperationDays * @return Returns a reference to this object so that method calls can be chained together. * @see HoursOfOperationDays */ Builder day(String day); /** *

* The day that the hours of operation applies to. *

* * @param day * The day that the hours of operation applies to. * @see HoursOfOperationDays * @return Returns a reference to this object so that method calls can be chained together. * @see HoursOfOperationDays */ Builder day(HoursOfOperationDays day); /** *

* The start time that your contact center opens. *

* * @param startTime * The start time that your contact center opens. * @return Returns a reference to this object so that method calls can be chained together. */ Builder startTime(HoursOfOperationTimeSlice startTime); /** *

* The start time that your contact center opens. *

* This is a convenience method that creates an instance of the {@link HoursOfOperationTimeSlice.Builder} * avoiding the need to create one manually via {@link HoursOfOperationTimeSlice#builder()}. * *

* When the {@link Consumer} completes, {@link HoursOfOperationTimeSlice.Builder#build()} is called immediately * and its result is passed to {@link #startTime(HoursOfOperationTimeSlice)}. * * @param startTime * a consumer that will call methods on {@link HoursOfOperationTimeSlice.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #startTime(HoursOfOperationTimeSlice) */ default Builder startTime(Consumer startTime) { return startTime(HoursOfOperationTimeSlice.builder().applyMutation(startTime).build()); } /** *

* The end time that your contact center closes. *

* * @param endTime * The end time that your contact center closes. * @return Returns a reference to this object so that method calls can be chained together. */ Builder endTime(HoursOfOperationTimeSlice endTime); /** *

* The end time that your contact center closes. *

* This is a convenience method that creates an instance of the {@link HoursOfOperationTimeSlice.Builder} * avoiding the need to create one manually via {@link HoursOfOperationTimeSlice#builder()}. * *

* When the {@link Consumer} completes, {@link HoursOfOperationTimeSlice.Builder#build()} is called immediately * and its result is passed to {@link #endTime(HoursOfOperationTimeSlice)}. * * @param endTime * a consumer that will call methods on {@link HoursOfOperationTimeSlice.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #endTime(HoursOfOperationTimeSlice) */ default Builder endTime(Consumer endTime) { return endTime(HoursOfOperationTimeSlice.builder().applyMutation(endTime).build()); } } static final class BuilderImpl implements Builder { private String day; private HoursOfOperationTimeSlice startTime; private HoursOfOperationTimeSlice endTime; private BuilderImpl() { } private BuilderImpl(HoursOfOperationConfig model) { day(model.day); startTime(model.startTime); endTime(model.endTime); } public final String getDay() { return day; } public final void setDay(String day) { this.day = day; } @Override public final Builder day(String day) { this.day = day; return this; } @Override public final Builder day(HoursOfOperationDays day) { this.day(day == null ? null : day.toString()); return this; } public final HoursOfOperationTimeSlice.Builder getStartTime() { return startTime != null ? startTime.toBuilder() : null; } public final void setStartTime(HoursOfOperationTimeSlice.BuilderImpl startTime) { this.startTime = startTime != null ? startTime.build() : null; } @Override public final Builder startTime(HoursOfOperationTimeSlice startTime) { this.startTime = startTime; return this; } public final HoursOfOperationTimeSlice.Builder getEndTime() { return endTime != null ? endTime.toBuilder() : null; } public final void setEndTime(HoursOfOperationTimeSlice.BuilderImpl endTime) { this.endTime = endTime != null ? endTime.build() : null; } @Override public final Builder endTime(HoursOfOperationTimeSlice endTime) { this.endTime = endTime; return this; } @Override public HoursOfOperationConfig build() { return new HoursOfOperationConfig(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy