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

software.amazon.awssdk.services.appstream.model.Application Maven / Gradle / Ivy

Go to download

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

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.appstream.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
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.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Describes an application in the application catalog. *

*/ @Generated("software.amazon.awssdk:codegen") public final class Application implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name") .getter(getter(Application::name)).setter(setter(Builder::name)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build(); private static final SdkField DISPLAY_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("DisplayName").getter(getter(Application::displayName)).setter(setter(Builder::displayName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DisplayName").build()).build(); private static final SdkField ICON_URL_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("IconURL").getter(getter(Application::iconURL)).setter(setter(Builder::iconURL)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IconURL").build()).build(); private static final SdkField LAUNCH_PATH_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("LaunchPath").getter(getter(Application::launchPath)).setter(setter(Builder::launchPath)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LaunchPath").build()).build(); private static final SdkField LAUNCH_PARAMETERS_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("LaunchParameters").getter(getter(Application::launchParameters)) .setter(setter(Builder::launchParameters)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LaunchParameters").build()).build(); private static final SdkField ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("Enabled").getter(getter(Application::enabled)).setter(setter(Builder::enabled)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Enabled").build()).build(); private static final SdkField> METADATA_FIELD = SdkField .> builder(MarshallingType.MAP) .memberName("Metadata") .getter(getter(Application::metadata)) .setter(setter(Builder::metadata)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Metadata").build(), MapTrait.builder() .keyLocationName("key") .valueLocationName("value") .valueFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("value").build()).build()).build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NAME_FIELD, DISPLAY_NAME_FIELD, ICON_URL_FIELD, LAUNCH_PATH_FIELD, LAUNCH_PARAMETERS_FIELD, ENABLED_FIELD, METADATA_FIELD)); private static final long serialVersionUID = 1L; private final String name; private final String displayName; private final String iconURL; private final String launchPath; private final String launchParameters; private final Boolean enabled; private final Map metadata; private Application(BuilderImpl builder) { this.name = builder.name; this.displayName = builder.displayName; this.iconURL = builder.iconURL; this.launchPath = builder.launchPath; this.launchParameters = builder.launchParameters; this.enabled = builder.enabled; this.metadata = builder.metadata; } /** *

* The name of the application. *

* * @return The name of the application. */ public final String name() { return name; } /** *

* The application name to display. *

* * @return The application name to display. */ public final String displayName() { return displayName; } /** *

* The URL for the application icon. This URL might be time-limited. *

* * @return The URL for the application icon. This URL might be time-limited. */ public final String iconURL() { return iconURL; } /** *

* The path to the application executable in the instance. *

* * @return The path to the application executable in the instance. */ public final String launchPath() { return launchPath; } /** *

* The arguments that are passed to the application at launch. *

* * @return The arguments that are passed to the application at launch. */ public final String launchParameters() { return launchParameters; } /** *

* If there is a problem, the application can be disabled after image creation. *

* * @return If there is a problem, the application can be disabled after image creation. */ public final Boolean enabled() { return enabled; } /** * Returns true if the Metadata property was specified by the sender (it may be empty), or false if the sender did * not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service. */ public final boolean hasMetadata() { return metadata != null && !(metadata instanceof SdkAutoConstructMap); } /** *

* Additional attributes that describe the application. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* You can use {@link #hasMetadata()} to see if a value was sent in this field. *

* * @return Additional attributes that describe the application. */ public final Map metadata() { return metadata; } @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(name()); hashCode = 31 * hashCode + Objects.hashCode(displayName()); hashCode = 31 * hashCode + Objects.hashCode(iconURL()); hashCode = 31 * hashCode + Objects.hashCode(launchPath()); hashCode = 31 * hashCode + Objects.hashCode(launchParameters()); hashCode = 31 * hashCode + Objects.hashCode(enabled()); hashCode = 31 * hashCode + Objects.hashCode(hasMetadata() ? metadata() : null); 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 Application)) { return false; } Application other = (Application) obj; return Objects.equals(name(), other.name()) && Objects.equals(displayName(), other.displayName()) && Objects.equals(iconURL(), other.iconURL()) && Objects.equals(launchPath(), other.launchPath()) && Objects.equals(launchParameters(), other.launchParameters()) && Objects.equals(enabled(), other.enabled()) && hasMetadata() == other.hasMetadata() && Objects.equals(metadata(), other.metadata()); } /** * 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("Application").add("Name", name()).add("DisplayName", displayName()).add("IconURL", iconURL()) .add("LaunchPath", launchPath()).add("LaunchParameters", launchParameters()).add("Enabled", enabled()) .add("Metadata", hasMetadata() ? metadata() : null).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Name": return Optional.ofNullable(clazz.cast(name())); case "DisplayName": return Optional.ofNullable(clazz.cast(displayName())); case "IconURL": return Optional.ofNullable(clazz.cast(iconURL())); case "LaunchPath": return Optional.ofNullable(clazz.cast(launchPath())); case "LaunchParameters": return Optional.ofNullable(clazz.cast(launchParameters())); case "Enabled": return Optional.ofNullable(clazz.cast(enabled())); case "Metadata": return Optional.ofNullable(clazz.cast(metadata())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((Application) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The name of the application. *

* * @param name * The name of the application. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

* The application name to display. *

* * @param displayName * The application name to display. * @return Returns a reference to this object so that method calls can be chained together. */ Builder displayName(String displayName); /** *

* The URL for the application icon. This URL might be time-limited. *

* * @param iconURL * The URL for the application icon. This URL might be time-limited. * @return Returns a reference to this object so that method calls can be chained together. */ Builder iconURL(String iconURL); /** *

* The path to the application executable in the instance. *

* * @param launchPath * The path to the application executable in the instance. * @return Returns a reference to this object so that method calls can be chained together. */ Builder launchPath(String launchPath); /** *

* The arguments that are passed to the application at launch. *

* * @param launchParameters * The arguments that are passed to the application at launch. * @return Returns a reference to this object so that method calls can be chained together. */ Builder launchParameters(String launchParameters); /** *

* If there is a problem, the application can be disabled after image creation. *

* * @param enabled * If there is a problem, the application can be disabled after image creation. * @return Returns a reference to this object so that method calls can be chained together. */ Builder enabled(Boolean enabled); /** *

* Additional attributes that describe the application. *

* * @param metadata * Additional attributes that describe the application. * @return Returns a reference to this object so that method calls can be chained together. */ Builder metadata(Map metadata); } static final class BuilderImpl implements Builder { private String name; private String displayName; private String iconURL; private String launchPath; private String launchParameters; private Boolean enabled; private Map metadata = DefaultSdkAutoConstructMap.getInstance(); private BuilderImpl() { } private BuilderImpl(Application model) { name(model.name); displayName(model.displayName); iconURL(model.iconURL); launchPath(model.launchPath); launchParameters(model.launchParameters); enabled(model.enabled); metadata(model.metadata); } public final String getName() { return name; } @Override public final Builder name(String name) { this.name = name; return this; } public final void setName(String name) { this.name = name; } public final String getDisplayName() { return displayName; } @Override public final Builder displayName(String displayName) { this.displayName = displayName; return this; } public final void setDisplayName(String displayName) { this.displayName = displayName; } public final String getIconURL() { return iconURL; } @Override public final Builder iconURL(String iconURL) { this.iconURL = iconURL; return this; } public final void setIconURL(String iconURL) { this.iconURL = iconURL; } public final String getLaunchPath() { return launchPath; } @Override public final Builder launchPath(String launchPath) { this.launchPath = launchPath; return this; } public final void setLaunchPath(String launchPath) { this.launchPath = launchPath; } public final String getLaunchParameters() { return launchParameters; } @Override public final Builder launchParameters(String launchParameters) { this.launchParameters = launchParameters; return this; } public final void setLaunchParameters(String launchParameters) { this.launchParameters = launchParameters; } public final Boolean getEnabled() { return enabled; } @Override public final Builder enabled(Boolean enabled) { this.enabled = enabled; return this; } public final void setEnabled(Boolean enabled) { this.enabled = enabled; } public final Map getMetadata() { if (metadata instanceof SdkAutoConstructMap) { return null; } return metadata; } @Override public final Builder metadata(Map metadata) { this.metadata = MetadataCopier.copy(metadata); return this; } public final void setMetadata(Map metadata) { this.metadata = MetadataCopier.copy(metadata); } @Override public Application build() { return new Application(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy