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

software.amazon.awssdk.services.opensearch.model.PluginProperties Maven / Gradle / Ivy

Go to download

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

The 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.opensearch.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Basic information about the plugin. *

*/ @Generated("software.amazon.awssdk:codegen") public final class PluginProperties implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name") .getter(getter(PluginProperties::name)).setter(setter(Builder::name)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build(); private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("Description").getter(getter(PluginProperties::description)).setter(setter(Builder::description)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build(); private static final SdkField VERSION_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Version") .getter(getter(PluginProperties::version)).setter(setter(Builder::version)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Version").build()).build(); private static final SdkField CLASS_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ClassName").getter(getter(PluginProperties::className)).setter(setter(Builder::className)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ClassName").build()).build(); private static final SdkField UNCOMPRESSED_SIZE_IN_BYTES_FIELD = SdkField. builder(MarshallingType.LONG) .memberName("UncompressedSizeInBytes").getter(getter(PluginProperties::uncompressedSizeInBytes)) .setter(setter(Builder::uncompressedSizeInBytes)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UncompressedSizeInBytes").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NAME_FIELD, DESCRIPTION_FIELD, VERSION_FIELD, CLASS_NAME_FIELD, UNCOMPRESSED_SIZE_IN_BYTES_FIELD)); private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer(); private static final long serialVersionUID = 1L; private final String name; private final String description; private final String version; private final String className; private final Long uncompressedSizeInBytes; private PluginProperties(BuilderImpl builder) { this.name = builder.name; this.description = builder.description; this.version = builder.version; this.className = builder.className; this.uncompressedSizeInBytes = builder.uncompressedSizeInBytes; } /** *

* The name of the plugin. *

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

* The description of the plugin. *

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

* The version of the plugin. *

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

* The name of the class to load. *

* * @return The name of the class to load. */ public final String className() { return className; } /** *

* The uncompressed size of the plugin. *

* * @return The uncompressed size of the plugin. */ public final Long uncompressedSizeInBytes() { return uncompressedSizeInBytes; } @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(description()); hashCode = 31 * hashCode + Objects.hashCode(version()); hashCode = 31 * hashCode + Objects.hashCode(className()); hashCode = 31 * hashCode + Objects.hashCode(uncompressedSizeInBytes()); 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 PluginProperties)) { return false; } PluginProperties other = (PluginProperties) obj; return Objects.equals(name(), other.name()) && Objects.equals(description(), other.description()) && Objects.equals(version(), other.version()) && Objects.equals(className(), other.className()) && Objects.equals(uncompressedSizeInBytes(), other.uncompressedSizeInBytes()); } /** * 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("PluginProperties").add("Name", name()).add("Description", description()) .add("Version", version()).add("ClassName", className()) .add("UncompressedSizeInBytes", uncompressedSizeInBytes()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Name": return Optional.ofNullable(clazz.cast(name())); case "Description": return Optional.ofNullable(clazz.cast(description())); case "Version": return Optional.ofNullable(clazz.cast(version())); case "ClassName": return Optional.ofNullable(clazz.cast(className())); case "UncompressedSizeInBytes": return Optional.ofNullable(clazz.cast(uncompressedSizeInBytes())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Map> memberNameToFieldInitializer() { Map> map = new HashMap<>(); map.put("Name", NAME_FIELD); map.put("Description", DESCRIPTION_FIELD); map.put("Version", VERSION_FIELD); map.put("ClassName", CLASS_NAME_FIELD); map.put("UncompressedSizeInBytes", UNCOMPRESSED_SIZE_IN_BYTES_FIELD); return Collections.unmodifiableMap(map); } private static Function getter(Function g) { return obj -> g.apply((PluginProperties) 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 plugin. *

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

* The description of the plugin. *

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

* The version of the plugin. *

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

* The name of the class to load. *

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

* The uncompressed size of the plugin. *

* * @param uncompressedSizeInBytes * The uncompressed size of the plugin. * @return Returns a reference to this object so that method calls can be chained together. */ Builder uncompressedSizeInBytes(Long uncompressedSizeInBytes); } static final class BuilderImpl implements Builder { private String name; private String description; private String version; private String className; private Long uncompressedSizeInBytes; private BuilderImpl() { } private BuilderImpl(PluginProperties model) { name(model.name); description(model.description); version(model.version); className(model.className); uncompressedSizeInBytes(model.uncompressedSizeInBytes); } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } public final String getVersion() { return version; } public final void setVersion(String version) { this.version = version; } @Override public final Builder version(String version) { this.version = version; return this; } public final String getClassName() { return className; } public final void setClassName(String className) { this.className = className; } @Override public final Builder className(String className) { this.className = className; return this; } public final Long getUncompressedSizeInBytes() { return uncompressedSizeInBytes; } public final void setUncompressedSizeInBytes(Long uncompressedSizeInBytes) { this.uncompressedSizeInBytes = uncompressedSizeInBytes; } @Override public final Builder uncompressedSizeInBytes(Long uncompressedSizeInBytes) { this.uncompressedSizeInBytes = uncompressedSizeInBytes; return this; } @Override public PluginProperties build() { return new PluginProperties(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy