net.osslabz.crypto.CurrencyPair Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of crypto-commons Show documentation
Show all versions of crypto-commons Show documentation
Provides common functionality for some of my crypto related projects.
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