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

net.osslabz.crypto.CurrencyPair Maven / Gradle / Ivy

There is a newer version: 0.5.0
Show newest version
package net.osslabz.crypto;


import java.util.Objects;

/**
 * Identifies a currency pair.
 *
 * @param baseCurrencyCode
 * @param counterCurrencyCode
 */
public record CurrencyPair(String baseCurrencyCode, String counterCurrencyCode) {

    public CurrencyPair {
        Objects.requireNonNull(baseCurrencyCode, "baseCurrencyCode cannot be null");
        Objects.requireNonNull(counterCurrencyCode, "counterCurrencyCode cannot be null");
    }

    public String getLabel() {
        return "%s-%s".formatted(this.baseCurrencyCode, this.counterCurrencyCode);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy