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

com.fireblocks.sdk.model.DelegationSummaryDto Maven / Gradle / Ivy

/*
 * Fireblocks API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.6.2
 * Contact: [email protected]
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

package com.fireblocks.sdk.model;


import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.StringJoiner;

/** DelegationSummaryDto */
@JsonPropertyOrder({
    DelegationSummaryDto.JSON_PROPERTY_ACTIVE,
    DelegationSummaryDto.JSON_PROPERTY_INACTIVE,
    DelegationSummaryDto.JSON_PROPERTY_REWARDS_AMOUNT,
    DelegationSummaryDto.JSON_PROPERTY_TOTAL_STAKED
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class DelegationSummaryDto {
    public static final String JSON_PROPERTY_ACTIVE = "active";
    private List active = new ArrayList<>();

    public static final String JSON_PROPERTY_INACTIVE = "inactive";
    private List inactive = new ArrayList<>();

    public static final String JSON_PROPERTY_REWARDS_AMOUNT = "rewardsAmount";
    private List rewardsAmount = new ArrayList<>();

    public static final String JSON_PROPERTY_TOTAL_STAKED = "totalStaked";
    private List totalStaked = new ArrayList<>();

    public DelegationSummaryDto() {}

    public DelegationSummaryDto active(List active) {
        this.active = active;
        return this;
    }

    public DelegationSummaryDto addActiveItem(AmountAndChainDescriptor activeItem) {
        if (this.active == null) {
            this.active = new ArrayList<>();
        }
        this.active.add(activeItem);
        return this;
    }

    /**
     * An array of objects containing chain descriptors and associated amounts, representing active
     * positions.
     *
     * @return active
     */
    @jakarta.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_ACTIVE)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public List getActive() {
        return active;
    }

    @JsonProperty(JSON_PROPERTY_ACTIVE)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setActive(List active) {
        this.active = active;
    }

    public DelegationSummaryDto inactive(List inactive) {
        this.inactive = inactive;
        return this;
    }

    public DelegationSummaryDto addInactiveItem(AmountAndChainDescriptor inactiveItem) {
        if (this.inactive == null) {
            this.inactive = new ArrayList<>();
        }
        this.inactive.add(inactiveItem);
        return this;
    }

    /**
     * An array of objects containing chain descriptors and associated amounts, representing
     * inactive positions.
     *
     * @return inactive
     */
    @jakarta.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_INACTIVE)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public List getInactive() {
        return inactive;
    }

    @JsonProperty(JSON_PROPERTY_INACTIVE)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setInactive(List inactive) {
        this.inactive = inactive;
    }

    public DelegationSummaryDto rewardsAmount(List rewardsAmount) {
        this.rewardsAmount = rewardsAmount;
        return this;
    }

    public DelegationSummaryDto addRewardsAmountItem(AmountAndChainDescriptor rewardsAmountItem) {
        if (this.rewardsAmount == null) {
            this.rewardsAmount = new ArrayList<>();
        }
        this.rewardsAmount.add(rewardsAmountItem);
        return this;
    }

    /**
     * An array of objects containing chain descriptors and associated amounts, representing rewards
     * positions.
     *
     * @return rewardsAmount
     */
    @jakarta.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_REWARDS_AMOUNT)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public List getRewardsAmount() {
        return rewardsAmount;
    }

    @JsonProperty(JSON_PROPERTY_REWARDS_AMOUNT)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setRewardsAmount(List rewardsAmount) {
        this.rewardsAmount = rewardsAmount;
    }

    public DelegationSummaryDto totalStaked(List totalStaked) {
        this.totalStaked = totalStaked;
        return this;
    }

    public DelegationSummaryDto addTotalStakedItem(AmountAndChainDescriptor totalStakedItem) {
        if (this.totalStaked == null) {
            this.totalStaked = new ArrayList<>();
        }
        this.totalStaked.add(totalStakedItem);
        return this;
    }

    /**
     * An array of objects with chain descriptors and total staked amounts, representing the
     * combined staked totals of active and inactive positions.
     *
     * @return totalStaked
     */
    @jakarta.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_TOTAL_STAKED)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public List getTotalStaked() {
        return totalStaked;
    }

    @JsonProperty(JSON_PROPERTY_TOTAL_STAKED)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setTotalStaked(List totalStaked) {
        this.totalStaked = totalStaked;
    }

    /** Return true if this DelegationSummaryDto object is equal to o. */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        DelegationSummaryDto delegationSummaryDto = (DelegationSummaryDto) o;
        return Objects.equals(this.active, delegationSummaryDto.active)
                && Objects.equals(this.inactive, delegationSummaryDto.inactive)
                && Objects.equals(this.rewardsAmount, delegationSummaryDto.rewardsAmount)
                && Objects.equals(this.totalStaked, delegationSummaryDto.totalStaked);
    }

    @Override
    public int hashCode() {
        return Objects.hash(active, inactive, rewardsAmount, totalStaked);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class DelegationSummaryDto {\n");
        sb.append("    active: ").append(toIndentedString(active)).append("\n");
        sb.append("    inactive: ").append(toIndentedString(inactive)).append("\n");
        sb.append("    rewardsAmount: ").append(toIndentedString(rewardsAmount)).append("\n");
        sb.append("    totalStaked: ").append(toIndentedString(totalStaked)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces (except the first
     * line).
     */
    private String toIndentedString(Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }

    /**
     * Convert the instance into URL query string.
     *
     * @return URL query string
     */
    public String toUrlQueryString() {
        return toUrlQueryString(null);
    }

    /**
     * Convert the instance into URL query string.
     *
     * @param prefix prefix of the query string
     * @return URL query string
     */
    public String toUrlQueryString(String prefix) {
        String suffix = "";
        String containerSuffix = "";
        String containerPrefix = "";
        if (prefix == null) {
            // style=form, explode=true, e.g. /pet?name=cat&type=manx
            prefix = "";
        } else {
            // deepObject style e.g. /pet?id[name]=cat&id[type]=manx
            prefix = prefix + "[";
            suffix = "]";
            containerSuffix = "]";
            containerPrefix = "[";
        }

        StringJoiner joiner = new StringJoiner("&");

        // add `active` to the URL query string
        if (getActive() != null) {
            for (int i = 0; i < getActive().size(); i++) {
                if (getActive().get(i) != null) {
                    joiner.add(
                            getActive()
                                    .get(i)
                                    .toUrlQueryString(
                                            String.format(
                                                    "%sactive%s%s",
                                                    prefix,
                                                    suffix,
                                                    "".equals(suffix)
                                                            ? ""
                                                            : String.format(
                                                                    "%s%d%s",
                                                                    containerPrefix,
                                                                    i,
                                                                    containerSuffix))));
                }
            }
        }

        // add `inactive` to the URL query string
        if (getInactive() != null) {
            for (int i = 0; i < getInactive().size(); i++) {
                if (getInactive().get(i) != null) {
                    joiner.add(
                            getInactive()
                                    .get(i)
                                    .toUrlQueryString(
                                            String.format(
                                                    "%sinactive%s%s",
                                                    prefix,
                                                    suffix,
                                                    "".equals(suffix)
                                                            ? ""
                                                            : String.format(
                                                                    "%s%d%s",
                                                                    containerPrefix,
                                                                    i,
                                                                    containerSuffix))));
                }
            }
        }

        // add `rewardsAmount` to the URL query string
        if (getRewardsAmount() != null) {
            for (int i = 0; i < getRewardsAmount().size(); i++) {
                if (getRewardsAmount().get(i) != null) {
                    joiner.add(
                            getRewardsAmount()
                                    .get(i)
                                    .toUrlQueryString(
                                            String.format(
                                                    "%srewardsAmount%s%s",
                                                    prefix,
                                                    suffix,
                                                    "".equals(suffix)
                                                            ? ""
                                                            : String.format(
                                                                    "%s%d%s",
                                                                    containerPrefix,
                                                                    i,
                                                                    containerSuffix))));
                }
            }
        }

        // add `totalStaked` to the URL query string
        if (getTotalStaked() != null) {
            for (int i = 0; i < getTotalStaked().size(); i++) {
                if (getTotalStaked().get(i) != null) {
                    joiner.add(
                            getTotalStaked()
                                    .get(i)
                                    .toUrlQueryString(
                                            String.format(
                                                    "%stotalStaked%s%s",
                                                    prefix,
                                                    suffix,
                                                    "".equals(suffix)
                                                            ? ""
                                                            : String.format(
                                                                    "%s%d%s",
                                                                    containerPrefix,
                                                                    i,
                                                                    containerSuffix))));
                }
            }
        }

        return joiner.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy