software.amazon.awssdk.services.opensearch.model.PluginProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of opensearch Show documentation
Show all versions of opensearch Show documentation
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 extends Builder> 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
© 2015 - 2025 Weber Informatics LLC | Privacy Policy