
software.amazon.awssdk.services.medialive.model.StaticImageActivateScheduleActionSettings Maven / Gradle / Ivy
/*
* 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.medialive.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;
/**
* Settings for the action to activate a static image.
*/
@Generated("software.amazon.awssdk:codegen")
public final class StaticImageActivateScheduleActionSettings implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField DURATION_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("Duration").getter(getter(StaticImageActivateScheduleActionSettings::duration))
.setter(setter(Builder::duration))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("duration").build()).build();
private static final SdkField FADE_IN_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("FadeIn").getter(getter(StaticImageActivateScheduleActionSettings::fadeIn))
.setter(setter(Builder::fadeIn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("fadeIn").build()).build();
private static final SdkField FADE_OUT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("FadeOut").getter(getter(StaticImageActivateScheduleActionSettings::fadeOut))
.setter(setter(Builder::fadeOut))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("fadeOut").build()).build();
private static final SdkField HEIGHT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("Height").getter(getter(StaticImageActivateScheduleActionSettings::height))
.setter(setter(Builder::height))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("height").build()).build();
private static final SdkField IMAGE_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("Image").getter(getter(StaticImageActivateScheduleActionSettings::image)).setter(setter(Builder::image))
.constructor(InputLocation::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("image").build()).build();
private static final SdkField IMAGEX_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("ImageX").getter(getter(StaticImageActivateScheduleActionSettings::imageX))
.setter(setter(Builder::imageX))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("imageX").build()).build();
private static final SdkField IMAGEY_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("ImageY").getter(getter(StaticImageActivateScheduleActionSettings::imageY))
.setter(setter(Builder::imageY))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("imageY").build()).build();
private static final SdkField LAYER_FIELD = SdkField. builder(MarshallingType.INTEGER).memberName("Layer")
.getter(getter(StaticImageActivateScheduleActionSettings::layer)).setter(setter(Builder::layer))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("layer").build()).build();
private static final SdkField OPACITY_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("Opacity").getter(getter(StaticImageActivateScheduleActionSettings::opacity))
.setter(setter(Builder::opacity))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("opacity").build()).build();
private static final SdkField WIDTH_FIELD = SdkField. builder(MarshallingType.INTEGER).memberName("Width")
.getter(getter(StaticImageActivateScheduleActionSettings::width)).setter(setter(Builder::width))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("width").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DURATION_FIELD, FADE_IN_FIELD,
FADE_OUT_FIELD, HEIGHT_FIELD, IMAGE_FIELD, IMAGEX_FIELD, IMAGEY_FIELD, LAYER_FIELD, OPACITY_FIELD, WIDTH_FIELD));
private static final long serialVersionUID = 1L;
private final Integer duration;
private final Integer fadeIn;
private final Integer fadeOut;
private final Integer height;
private final InputLocation image;
private final Integer imageX;
private final Integer imageY;
private final Integer layer;
private final Integer opacity;
private final Integer width;
private StaticImageActivateScheduleActionSettings(BuilderImpl builder) {
this.duration = builder.duration;
this.fadeIn = builder.fadeIn;
this.fadeOut = builder.fadeOut;
this.height = builder.height;
this.image = builder.image;
this.imageX = builder.imageX;
this.imageY = builder.imageY;
this.layer = builder.layer;
this.opacity = builder.opacity;
this.width = builder.width;
}
/**
* The duration in milliseconds for the image to remain on the video. If omitted or set to 0 the duration is
* unlimited and the image will remain until it is explicitly deactivated.
*
* @return The duration in milliseconds for the image to remain on the video. If omitted or set to 0 the duration is
* unlimited and the image will remain until it is explicitly deactivated.
*/
public final Integer duration() {
return duration;
}
/**
* The time in milliseconds for the image to fade in. The fade-in starts at the start time of the overlay. Default
* is 0 (no fade-in).
*
* @return The time in milliseconds for the image to fade in. The fade-in starts at the start time of the overlay.
* Default is 0 (no fade-in).
*/
public final Integer fadeIn() {
return fadeIn;
}
/**
* Applies only if a duration is specified. The time in milliseconds for the image to fade out. The fade-out starts
* when the duration time is hit, so it effectively extends the duration. Default is 0 (no fade-out).
*
* @return Applies only if a duration is specified. The time in milliseconds for the image to fade out. The fade-out
* starts when the duration time is hit, so it effectively extends the duration. Default is 0 (no fade-out).
*/
public final Integer fadeOut() {
return fadeOut;
}
/**
* The height of the image when inserted into the video, in pixels. The overlay will be scaled up or down to the
* specified height. Leave blank to use the native height of the overlay.
*
* @return The height of the image when inserted into the video, in pixels. The overlay will be scaled up or down to
* the specified height. Leave blank to use the native height of the overlay.
*/
public final Integer height() {
return height;
}
/**
* The location and filename of the image file to overlay on the video. The file must be a 32-bit BMP, PNG, or TGA
* file, and must not be larger (in pixels) than the input video.
*
* @return The location and filename of the image file to overlay on the video. The file must be a 32-bit BMP, PNG,
* or TGA file, and must not be larger (in pixels) than the input video.
*/
public final InputLocation image() {
return image;
}
/**
* Placement of the left edge of the overlay relative to the left edge of the video frame, in pixels. 0 (the
* default) is the left edge of the frame. If the placement causes the overlay to extend beyond the right edge of
* the underlying video, then the overlay is cropped on the right.
*
* @return Placement of the left edge of the overlay relative to the left edge of the video frame, in pixels. 0 (the
* default) is the left edge of the frame. If the placement causes the overlay to extend beyond the right
* edge of the underlying video, then the overlay is cropped on the right.
*/
public final Integer imageX() {
return imageX;
}
/**
* Placement of the top edge of the overlay relative to the top edge of the video frame, in pixels. 0 (the default)
* is the top edge of the frame. If the placement causes the overlay to extend beyond the bottom edge of the
* underlying video, then the overlay is cropped on the bottom.
*
* @return Placement of the top edge of the overlay relative to the top edge of the video frame, in pixels. 0 (the
* default) is the top edge of the frame. If the placement causes the overlay to extend beyond the bottom
* edge of the underlying video, then the overlay is cropped on the bottom.
*/
public final Integer imageY() {
return imageY;
}
/**
* The number of the layer, 0 to 7. There are 8 layers that can be overlaid on the video, each layer with a
* different image. The layers are in Z order, which means that overlays with higher values of layer are inserted on
* top of overlays with lower values of layer. Default is 0.
*
* @return The number of the layer, 0 to 7. There are 8 layers that can be overlaid on the video, each layer with a
* different image. The layers are in Z order, which means that overlays with higher values of layer are
* inserted on top of overlays with lower values of layer. Default is 0.
*/
public final Integer layer() {
return layer;
}
/**
* Opacity of image where 0 is transparent and 100 is fully opaque. Default is 100.
*
* @return Opacity of image where 0 is transparent and 100 is fully opaque. Default is 100.
*/
public final Integer opacity() {
return opacity;
}
/**
* The width of the image when inserted into the video, in pixels. The overlay will be scaled up or down to the
* specified width. Leave blank to use the native width of the overlay.
*
* @return The width of the image when inserted into the video, in pixels. The overlay will be scaled up or down to
* the specified width. Leave blank to use the native width of the overlay.
*/
public final Integer width() {
return width;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(duration());
hashCode = 31 * hashCode + Objects.hashCode(fadeIn());
hashCode = 31 * hashCode + Objects.hashCode(fadeOut());
hashCode = 31 * hashCode + Objects.hashCode(height());
hashCode = 31 * hashCode + Objects.hashCode(image());
hashCode = 31 * hashCode + Objects.hashCode(imageX());
hashCode = 31 * hashCode + Objects.hashCode(imageY());
hashCode = 31 * hashCode + Objects.hashCode(layer());
hashCode = 31 * hashCode + Objects.hashCode(opacity());
hashCode = 31 * hashCode + Objects.hashCode(width());
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 StaticImageActivateScheduleActionSettings)) {
return false;
}
StaticImageActivateScheduleActionSettings other = (StaticImageActivateScheduleActionSettings) obj;
return Objects.equals(duration(), other.duration()) && Objects.equals(fadeIn(), other.fadeIn())
&& Objects.equals(fadeOut(), other.fadeOut()) && Objects.equals(height(), other.height())
&& Objects.equals(image(), other.image()) && Objects.equals(imageX(), other.imageX())
&& Objects.equals(imageY(), other.imageY()) && Objects.equals(layer(), other.layer())
&& Objects.equals(opacity(), other.opacity()) && Objects.equals(width(), other.width());
}
/**
* 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("StaticImageActivateScheduleActionSettings").add("Duration", duration()).add("FadeIn", fadeIn())
.add("FadeOut", fadeOut()).add("Height", height()).add("Image", image()).add("ImageX", imageX())
.add("ImageY", imageY()).add("Layer", layer()).add("Opacity", opacity()).add("Width", width()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Duration":
return Optional.ofNullable(clazz.cast(duration()));
case "FadeIn":
return Optional.ofNullable(clazz.cast(fadeIn()));
case "FadeOut":
return Optional.ofNullable(clazz.cast(fadeOut()));
case "Height":
return Optional.ofNullable(clazz.cast(height()));
case "Image":
return Optional.ofNullable(clazz.cast(image()));
case "ImageX":
return Optional.ofNullable(clazz.cast(imageX()));
case "ImageY":
return Optional.ofNullable(clazz.cast(imageY()));
case "Layer":
return Optional.ofNullable(clazz.cast(layer()));
case "Opacity":
return Optional.ofNullable(clazz.cast(opacity()));
case "Width":
return Optional.ofNullable(clazz.cast(width()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy