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

io.proximax.sdk.utils.dto.BlockchainScoreDTOUtils Maven / Gradle / Ivy

Go to download

The ProximaX Sirius Chain Java SDK is a Java library for interacting with the Sirius Blockchain.

The newest version!
/**
 * 
 */
package io.proximax.sdk.utils.dto;

import java.math.BigInteger;

import io.proximax.sdk.gen.model.BlockchainScoreDTO;

/**
 * Utility class to manage BlockchainScoreDTO instances
 * 
 * @author tonowie
 */
public class BlockchainScoreDTOUtils {

	/**
	 * utility class should not be instantiated
	 */
	private BlockchainScoreDTOUtils() {
		// hiding utility constructor
	}
	
    /**
     * convert BlockchainScoreDTO to BigInteger instance
     * 
     * @param score BlockchainScoreDTO instance representing low and high score
     * @return BigInteger created from the low and high scores
     */
    public static BigInteger toBigInt(BlockchainScoreDTO score) {
    	int low = UInt64Utils.toBigInt(score.getScoreLow()).intValue();
    	int high = UInt64Utils.toBigInt(score.getScoreHigh()).intValue();
    	return UInt64Utils.fromIntArray(new int[]{low, high});
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy