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

software.amazon.awssdk.services.snowdevicemanagement.model.Capacity Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.28.4
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.snowdevicemanagement.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.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;

/**
 * 

* The physical capacity of the Amazon Web Services Snow Family device. *

*/ @Generated("software.amazon.awssdk:codegen") public final class Capacity implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField AVAILABLE_FIELD = SdkField. builder(MarshallingType.LONG).memberName("available") .getter(getter(Capacity::available)).setter(setter(Builder::available)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("available").build()).build(); private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name") .getter(getter(Capacity::name)).setter(setter(Builder::name)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build(); private static final SdkField TOTAL_FIELD = SdkField. builder(MarshallingType.LONG).memberName("total") .getter(getter(Capacity::total)).setter(setter(Builder::total)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("total").build()).build(); private static final SdkField UNIT_FIELD = SdkField. builder(MarshallingType.STRING).memberName("unit") .getter(getter(Capacity::unit)).setter(setter(Builder::unit)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("unit").build()).build(); private static final SdkField USED_FIELD = SdkField. builder(MarshallingType.LONG).memberName("used") .getter(getter(Capacity::used)).setter(setter(Builder::used)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("used").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(AVAILABLE_FIELD, NAME_FIELD, TOTAL_FIELD, UNIT_FIELD, USED_FIELD)); private static final long serialVersionUID = 1L; private final Long available; private final String name; private final Long total; private final String unit; private final Long used; private Capacity(BuilderImpl builder) { this.available = builder.available; this.name = builder.name; this.total = builder.total; this.unit = builder.unit; this.used = builder.used; } /** *

* The amount of capacity available for use on the device. *

* * @return The amount of capacity available for use on the device. */ public final Long available() { return available; } /** *

* The name of the type of capacity, such as memory. *

* * @return The name of the type of capacity, such as memory. */ public final String name() { return name; } /** *

* The total capacity on the device. *

* * @return The total capacity on the device. */ public final Long total() { return total; } /** *

* The unit of measure for the type of capacity. *

* * @return The unit of measure for the type of capacity. */ public final String unit() { return unit; } /** *

* The amount of capacity used on the device. *

* * @return The amount of capacity used on the device. */ public final Long used() { return used; } @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(available()); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(total()); hashCode = 31 * hashCode + Objects.hashCode(unit()); hashCode = 31 * hashCode + Objects.hashCode(used()); 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 Capacity)) { return false; } Capacity other = (Capacity) obj; return Objects.equals(available(), other.available()) && Objects.equals(name(), other.name()) && Objects.equals(total(), other.total()) && Objects.equals(unit(), other.unit()) && Objects.equals(used(), other.used()); } /** * 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("Capacity").add("Available", available()).add("Name", name()).add("Total", total()) .add("Unit", unit()).add("Used", used()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "available": return Optional.ofNullable(clazz.cast(available())); case "name": return Optional.ofNullable(clazz.cast(name())); case "total": return Optional.ofNullable(clazz.cast(total())); case "unit": return Optional.ofNullable(clazz.cast(unit())); case "used": return Optional.ofNullable(clazz.cast(used())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((Capacity) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The amount of capacity available for use on the device. *

* * @param available * The amount of capacity available for use on the device. * @return Returns a reference to this object so that method calls can be chained together. */ Builder available(Long available); /** *

* The name of the type of capacity, such as memory. *

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

* The total capacity on the device. *

* * @param total * The total capacity on the device. * @return Returns a reference to this object so that method calls can be chained together. */ Builder total(Long total); /** *

* The unit of measure for the type of capacity. *

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

* The amount of capacity used on the device. *

* * @param used * The amount of capacity used on the device. * @return Returns a reference to this object so that method calls can be chained together. */ Builder used(Long used); } static final class BuilderImpl implements Builder { private Long available; private String name; private Long total; private String unit; private Long used; private BuilderImpl() { } private BuilderImpl(Capacity model) { available(model.available); name(model.name); total(model.total); unit(model.unit); used(model.used); } public final Long getAvailable() { return available; } public final void setAvailable(Long available) { this.available = available; } @Override public final Builder available(Long available) { this.available = available; return this; } 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 Long getTotal() { return total; } public final void setTotal(Long total) { this.total = total; } @Override public final Builder total(Long total) { this.total = total; return this; } public final String getUnit() { return unit; } public final void setUnit(String unit) { this.unit = unit; } @Override public final Builder unit(String unit) { this.unit = unit; return this; } public final Long getUsed() { return used; } public final void setUsed(Long used) { this.used = used; } @Override public final Builder used(Long used) { this.used = used; return this; } @Override public Capacity build() { return new Capacity(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy