
%

%   Copyright 2015-2017 The MathWorks, Inc.

classdef WebServiceMessagesCache < handle

    properties (Access = private)
        CachedMessages
    end

    methods
        function obj = WebServiceMessagesCache()
            obj.CachedMessages = containers.Map();
        end

        function addMessage(obj, messageId, messageText)
            obj.CachedMessages(messageId) = messageText;
        end

        function tf = hasMessageFor(obj, messageId)
            tf = obj.CachedMessages.isKey(messageId);
        end

        function clear(obj)
            obj.CachedMessages = containers.Map();
        end
    end
end
