public static StockEvent From(string message) { if (!message.Contains(":") || !message.Contains(";")) { throw new ArgumentException(); } Dictionary <string, string> fields = GetFields(message); StockEventType eventType = GetEventType(fields); return(new StockEvent(eventType, fields)); }
private StockEvent(StockEventType type, Dictionary <string, string> fields) { Type = type; _fields = fields; }