/* * Copyright 2018-2023 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 com.amazonaws.services.datasync.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* The storage capacity of an on-premises storage system resource (for example, a volume). *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class Capacity implements Serializable, Cloneable, StructuredPojo { /** *

* The amount of space that's being used in a storage system resource. *

*/ private Long used; /** *

* The total amount of space available in a storage system resource. *

*/ private Long provisioned; /** *

* The amount of space that's being used in a storage system resource without accounting for compression or * deduplication. *

*/ private Long logicalUsed; /** *

* The amount of space that's being used in a storage system resource. *

* * @param used * The amount of space that's being used in a storage system resource. */ public void setUsed(Long used) { this.used = used; } /** *

* The amount of space that's being used in a storage system resource. *

* * @return The amount of space that's being used in a storage system resource. */ public Long getUsed() { return this.used; } /** *

* The amount of space that's being used in a storage system resource. *

* * @param used * The amount of space that's being used in a storage system resource. * @return Returns a reference to this object so that method calls can be chained together. */ public Capacity withUsed(Long used) { setUsed(used); return this; } /** *

* The total amount of space available in a storage system resource. *

* * @param provisioned * The total amount of space available in a storage system resource. */ public void setProvisioned(Long provisioned) { this.provisioned = provisioned; } /** *

* The total amount of space available in a storage system resource. *

* * @return The total amount of space available in a storage system resource. */ public Long getProvisioned() { return this.provisioned; } /** *

* The total amount of space available in a storage system resource. *

* * @param provisioned * The total amount of space available in a storage system resource. * @return Returns a reference to this object so that method calls can be chained together. */ public Capacity withProvisioned(Long provisioned) { setProvisioned(provisioned); return this; } /** *

* The amount of space that's being used in a storage system resource without accounting for compression or * deduplication. *

* * @param logicalUsed * The amount of space that's being used in a storage system resource without accounting for compression or * deduplication. */ public void setLogicalUsed(Long logicalUsed) { this.logicalUsed = logicalUsed; } /** *

* The amount of space that's being used in a storage system resource without accounting for compression or * deduplication. *

* * @return The amount of space that's being used in a storage system resource without accounting for compression or * deduplication. */ public Long getLogicalUsed() { return this.logicalUsed; } /** *

* The amount of space that's being used in a storage system resource without accounting for compression or * deduplication. *

* * @param logicalUsed * The amount of space that's being used in a storage system resource without accounting for compression or * deduplication. * @return Returns a reference to this object so that method calls can be chained together. */ public Capacity withLogicalUsed(Long logicalUsed) { setLogicalUsed(logicalUsed); return this; } /** * 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. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getUsed() != null) sb.append("Used: ").append(getUsed()).append(","); if (getProvisioned() != null) sb.append("Provisioned: ").append(getProvisioned()).append(","); if (getLogicalUsed() != null) sb.append("LogicalUsed: ").append(getLogicalUsed()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Capacity == false) return false; Capacity other = (Capacity) obj; if (other.getUsed() == null ^ this.getUsed() == null) return false; if (other.getUsed() != null && other.getUsed().equals(this.getUsed()) == false) return false; if (other.getProvisioned() == null ^ this.getProvisioned() == null) return false; if (other.getProvisioned() != null && other.getProvisioned().equals(this.getProvisioned()) == false) return false; if (other.getLogicalUsed() == null ^ this.getLogicalUsed() == null) return false; if (other.getLogicalUsed() != null && other.getLogicalUsed().equals(this.getLogicalUsed()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getUsed() == null) ? 0 : getUsed().hashCode()); hashCode = prime * hashCode + ((getProvisioned() == null) ? 0 : getProvisioned().hashCode()); hashCode = prime * hashCode + ((getLogicalUsed() == null) ? 0 : getLogicalUsed().hashCode()); return hashCode; } @Override public Capacity clone() { try { return (Capacity) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.datasync.model.transform.CapacityMarshaller.getInstance().marshall(this, protocolMarshaller); } }