Apache.NMS.Util.PrimitiveMapInterceptor.GetDouble C# (CSharp) Method

GetDouble() public method

public GetDouble ( string key ) : double
key string
return double
        public double GetDouble(string key)
        {
            Object value = GetObjectProperty(key);

            try
            {
                if(value is Double)
                {
                    return (double) value;
                }
                else if(value is Single || value is String)
                {
                    return Convert.ToDouble(value);
                }
                else
                {
                    throw new MessageFormatException(" cannot read a double from " + value.GetType().Name);
                }
            }
            catch(FormatException ex)
            {
                throw NMSExceptionSupport.CreateMessageFormatException(ex);
            }
        }