com.klaytn.caver.methods.response.GovernanceStakingInfo Maven / Gradle / Ivy
/*
* Copyright 2021 The caver-java Authors
*
* Licensed under the Apache License, Version 2.0 (the “License”);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License 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.klaytn.caver.methods.response;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.klaytn.caver.rpc.Governance;
import com.klaytn.caver.utils.Utils;
import org.web3j.protocol.core.Response;
import java.math.BigInteger;
import java.util.List;
/**
* The class represented to store the response data of the {@link Governance#getStakingInfo()} method.
*/
public class GovernanceStakingInfo extends Response {
public static class StakingInfo {
/**
* The boolean value whether or not the Gini coefficient is used.
*/
@JsonProperty("UseGini")
private boolean useGini;
/**
* The contract address of PoC.
* PoC is the previous name of KGF.
*/
@JsonProperty("PoCAddr")
private String pocAddr;
/**
* The contract address of KIR.
*/
@JsonProperty("KIRAddr")
private String kirAddr;
/**
* The contract address of PoC.
* PoC is the previous name of KGF.
*/
@JsonProperty("kffAddr")
private String kffAddr;
/**
* The contract address of KIR.
*/
@JsonProperty("kcfAddr")
private String kcfAddr;
/**
* Gini coefficient.
*/
@JsonProperty("Gini")
private int gini;
/**
* The amount of KLAY which the associated nodes stake.
*/
@JsonProperty("CouncilStakingAmounts")
private List councilStakingAmounts;
/**
* The contract addresses in which the associated nodes deploy for staking.
*/
@JsonProperty("CouncilStakingAddrs")
private List councilStakingAddrs;
/**
* The addresses to which the block reward of the associated nodes is sent.
*/
@JsonProperty("CouncilRewardAddrs")
private List councilRewardAddrs;
/**
* The addresses of the consensus node.
*/
@JsonProperty("CouncilNodeAddrs")
private List councilNodeAddrs;
@JsonProperty("BlockNum")
private BigInteger blockNum;
public StakingInfo() {
}
public StakingInfo(boolean useGini, String pocAddr, String kirAddr, int gini, List councilStakingAmounts, List councilStakingAddrs, List councilRewardAddrs, List councilModeAddrs, BigInteger blockNum) {
this.useGini = useGini;
this.pocAddr = pocAddr;
this.kirAddr = kirAddr;
this.gini = gini;
this.councilStakingAmounts = councilStakingAmounts;
this.councilStakingAddrs = councilStakingAddrs;
this.councilRewardAddrs = councilRewardAddrs;
this.councilNodeAddrs = councilModeAddrs;
this.blockNum = blockNum;
}
public StakingInfo(boolean useGini, String pocAddr, String kirAddr, String kffAddr, String kcfAddr, int gini,
List councilStakingAmounts, List councilStakingAddrs,
List councilRewardAddrs, List councilNodeAddrs, BigInteger blockNum) {
this.useGini = useGini;
this.pocAddr = pocAddr;
this.kirAddr = kirAddr;
this.kffAddr = kffAddr;
this.kcfAddr = kcfAddr;
this.gini = gini;
this.councilStakingAmounts = councilStakingAmounts;
this.councilStakingAddrs = councilStakingAddrs;
this.councilRewardAddrs = councilRewardAddrs;
this.councilNodeAddrs = councilNodeAddrs;
this.blockNum = blockNum;
}
/**
* Getter function for useGini
* @return boolean
*/
public boolean isUseGini() {
return useGini;
}
/**
* Setter function for useGini.
* @param useGini The boolean value whether or not the Gini coefficient is used.
*/
public void setUseGini(boolean useGini) {
this.useGini = useGini;
}
/**
* Getter function for KGFAddr.
* @return String
*/
public String getKGFAddr() {
return pocAddr;
}
/**
* Getter function for PocAddr.
* PoC is the previous name of KGF.
* @return String
*/
public String getPocAddr() {
return pocAddr;
}
/**
* Setter function for PocAddr.
* PoC is the previous name of KGF.
* @param pocAddr The contract address of PoC.
*/
public void setPocAddr(String pocAddr) {
this.pocAddr = pocAddr;
}
/**
* Getter function for KIRAddr.
* @return String
*/
public String getKirAddr() {
return kirAddr;
}
/**
* Setter function for KIRAddr
* @param kirAddr The contract address of KIR.
*/
public void setKirAddr(String kirAddr) {
this.kirAddr = kirAddr;
}
/**
* Getter function for kffAddr.
* @return String
*/
public String getKffAddr() {
return kffAddr;
}
/**
* Setter function for kffAddr
* @param kffAddr The contract address of KFF.
*/
public void setKffAddr(String kffAddr) {
this.kffAddr = kffAddr;
}
/**
* Getter function for kcfAddr.
* @return String
*/
public String getKcfAddr() {
return kcfAddr;
}
/**
* Setter function for kcfAddr
* @param kcfAddr The contract address of KCF.
*/
public void setKcfAddr(String kcfAddr) {
this.kcfAddr = kcfAddr;
}
/**
* Getter function for Gini
* @return int
*/
public int getGini() {
return gini;
}
/**
* Setter function for Gini
* @param gini The Gini coefficient.
*/
public void setGini(int gini) {
this.gini = gini;
}
/**
* Getter function for councilStakingAmounts
* @return List<BigInteger>
*/
public List getCouncilStakingAmounts() {
return councilStakingAmounts;
}
/**
* Setter function for councilStakingAmounts
* @param councilStakingAmounts The amount of KLAY which the associated nodes stake.
*/
public void setCouncilStakingAmounts(List councilStakingAmounts) {
this.councilStakingAmounts = councilStakingAmounts;
}
/**
* Getter function for councilStakingAddrs.
* @return List<String>
*/
public List getCouncilStakingAddrs() {
return councilStakingAddrs;
}
/**
* Setter function for councilStakingAddrs
* @param councilStakingAddrs The contract addresses in which the associated nodes deploy for staking.
*/
public void setCouncilStakingAddrs(List councilStakingAddrs) {
this.councilStakingAddrs = councilStakingAddrs;
}
/**
* Getter function for councilRewardAddrs
* @return List<String>
*/
public List getCouncilRewardAddrs() {
return councilRewardAddrs;
}
/**
* Setter function for councilRewardAddrs
* @param councilRewardAddrs List<String>
*/
public void setCouncilRewardAddrs(List councilRewardAddrs) {
this.councilRewardAddrs = councilRewardAddrs;
}
/**
* Getter function for councilNodeAddrs
* @return List<String>
*/
public List getCouncilNodeAddrs() {
return councilNodeAddrs;
}
/**
* Setter function for councilNodeAddrs
* @param councilNodeAddrs List<String>
*/
public void setCouncilNodeAddrs(List councilNodeAddrs) {
this.councilNodeAddrs = councilNodeAddrs;
}
/**
* Getter function for blockNum
* @return BigInteger
*/
public BigInteger getBlockNum() {
return blockNum;
}
/**
* Setter function for blockNum
* @param blockNum The block number at which the staking information is given.
*/
public void setBlockNum(BigInteger blockNum) {
this.blockNum = blockNum;
}
@Override
public String toString() {
return Utils.printString(this);
}
}
@Override
public String toString() {
return Utils.printString(this);
}
}