package io.gimbalabs.hilltop.api.v0.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonProcessingException; import java.io.IOException; import java.lang.Double; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; /** * Generated by API Builder - https://www.apibuilder.io * Service version: 0.0.1-SNAPSHOT * User agent: apibuilder app.apibuilder.io/gimbalabs/hilltop-api/0.0.1-SNAPSHOT/android_rx2_client * * WARNING: not all features (notably unions) and data types work with android generator yet. * Android generator is designed to be used in an android application, but should work in any java codebase as long as you import jackson, retrofit2 and RxJava2 libraries. * If you are considering using this library, would like to request/discuss features, or would like to share how you're using it, please contact android-feedback@gilt.com * */ @JsonIgnoreProperties( ignoreUnknown = true ) public class Stakepool { private final String id; private final String poolIdBech32; private final StakepoolMetadata metadata; private final Long cost; private final Double margin; private final Long pledge; private final Long activeStake; private final Double saturation; private final Long retiringAtEpoch; @JsonCreator public Stakepool(@JsonProperty("id") String id, @JsonProperty("pool_id_bech32") String poolIdBech32, @JsonProperty("metadata") StakepoolMetadata metadata, @JsonProperty("cost") Long cost, @JsonProperty("margin") Double margin, @JsonProperty("pledge") Long pledge, @JsonProperty("active_stake") Long activeStake, @JsonProperty("saturation") Double saturation, @JsonProperty("retiring_at_epoch") Long retiringAtEpoch) { this.id = id; this.poolIdBech32 = poolIdBech32; this.metadata = metadata; this.cost = cost; this.margin = margin; this.pledge = pledge; this.activeStake = activeStake; this.saturation = saturation; this.retiringAtEpoch = retiringAtEpoch; } /** * the id of the pool */ public String getId() { return id; } /** * the id in bech32 format of the pool */ public String getPoolIdBech32() { return poolIdBech32; } public StakepoolMetadata getMetadata() { return metadata; } /** * operational costs per epoch in lovelaces */ public Long getCost() { return cost; } /** * operator margin, percentage (from 0 to 1) */ public Double getMargin() { return margin; } /** * pledge amount, in lovelaces */ public Long getPledge() { return pledge; } /** * active stake for current epoch in lovelaces */ public Long getActiveStake() { return activeStake; } /** * pool saturation as percentage (0 to 1) */ public Double getSaturation() { return saturation; } /** * if defined, is the epoch at which the pool will retire */ public Long getRetiringAtEpoch() { return retiringAtEpoch; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Stakepool that = (Stakepool) o; if (id != null ? !id.equals(that.id) : that.id != null) return false; if (poolIdBech32 != null ? !poolIdBech32.equals(that.poolIdBech32) : that.poolIdBech32 != null) return false; if (metadata != null ? !metadata.equals(that.metadata) : that.metadata != null) return false; if (cost != null ? !cost.equals(that.cost) : that.cost != null) return false; if (margin != null ? !margin.equals(that.margin) : that.margin != null) return false; if (pledge != null ? !pledge.equals(that.pledge) : that.pledge != null) return false; if (activeStake != null ? !activeStake.equals(that.activeStake) : that.activeStake != null) return false; if (saturation != null ? !saturation.equals(that.saturation) : that.saturation != null) return false; if (retiringAtEpoch != null ? !retiringAtEpoch.equals(that.retiringAtEpoch) : that.retiringAtEpoch != null) return false; return true; } @Override public int hashCode() { int result = 0; result = 31 * result + (id != null ? id.hashCode() : 0); result = 31 * result + (poolIdBech32 != null ? poolIdBech32.hashCode() : 0); result = 31 * result + (metadata != null ? metadata.hashCode() : 0); result = 31 * result + (cost != null ? cost.hashCode() : 0); result = 31 * result + (margin != null ? margin.hashCode() : 0); result = 31 * result + (pledge != null ? pledge.hashCode() : 0); result = 31 * result + (activeStake != null ? activeStake.hashCode() : 0); result = 31 * result + (saturation != null ? saturation.hashCode() : 0); result = 31 * result + (retiringAtEpoch != null ? retiringAtEpoch.hashCode() : 0); return result; } public String toJsonString() throws JsonProcessingException { return io.gimbalabs.hilltop.api.v0.android.ApiBuilderObjectMapper.getInstance().writeValueAsString(this); } public static Stakepool parseJson(String json) throws IOException { return io.gimbalabs.hilltop.api.v0.android.ApiBuilderObjectMapper.getInstance().readValue( json, Stakepool.class); } }