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

com.fluxtion.server.lib.pnl.refdata.InMemorySymbolLookup Maven / Gradle / Ivy

There is a newer version: 0.1.29
Show newest version
/*
 * 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