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

io.contek.zeus.AssetSymbol Maven / Gradle / Ivy

There is a newer version: 2.29.0
Show newest version
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());
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy