io.contek.zeus.AssetSymbol Maven / Gradle / Ivy
package io.contek.zeus;
import com.google.common.collect.ImmutableSet;
import io.contek.zeus.common.MarginBalanceSnapshot;
import javax.annotation.concurrent.Immutable;
import java.util.Collection;
import static com.google.common.collect.ImmutableSet.toImmutableSet;
@Immutable
public final class AssetSymbol extends StringKey {
private AssetSymbol(String stringValue) {
super(stringValue);
}
public static AssetSymbol of(MarginBalanceSnapshot marginBalance) {
return AssetSymbol.of(marginBalance.getAssetSymbol());
}
public static AssetSymbol of(String stringValue) {
return new AssetSymbol(stringValue);
}
public static ImmutableSet setOf(Collection stringValues) {
return stringValues.stream().map(AssetSymbol::of).collect(toImmutableSet());
}
}