com.fluxtion.server.lib.pnl.refdata.InMemorySymbolLookup Maven / Gradle / Ivy
/*
* SPDX-FileCopyrightText: © 2024 Gregory Higgins
* SPDX-License-Identifier: AGPL-3.0-only
*/
package com.fluxtion.server.lib.pnl.refdata;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
public class InMemorySymbolLookup
implements
SymbolLookup {
private final Map symbolMap = new HashMap<>();
public InMemorySymbolLookup() {
addSymbol(SYMBOL_USD);
addSymbol(SYMBOL_USDT);
addSymbol(SYMBOL_GBP);
}
@Override
public Symbol getSymbolForName(String symbol) {
return symbolMap.get(symbol);
}
@Override
public Collection symbols() {
return symbolMap.values();
}
public SymbolLookup addSymbol(Symbol symbol) {
symbolMap.put(symbol.symbolName(), symbol);
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy