internal JsonRpcMethod(Builder methodBuilder, JsonRpcServiceClass clazz)
        {
            Debug.Assert(methodBuilder != null);
            Debug.Assert(clazz != null);
            
            _name = methodBuilder.Name;
            _internalName = Mask.EmptyString(methodBuilder.InternalName, methodBuilder.Name);
            _resultType = methodBuilder.ResultType;
            _isObsolete = methodBuilder.IsObsolete;
            _obsoletionMessage = methodBuilder.IsObsolete ? methodBuilder.ObsoletionMessage : string.Empty;
            _description = methodBuilder.Description;
            _dispatcher = methodBuilder.Dispatcher;
            _class = clazz;
            
            JsonRpcParameter.Builder[] parameterBuilders = methodBuilder.GetParameterBuilders();
            _parameters = new JsonRpcParameter[parameterBuilders.Length];
            int paramIndex = 0;

            foreach (JsonRpcParameter.Builder parameterBuilder in parameterBuilders)
                _parameters[paramIndex++] = new JsonRpcParameter(parameterBuilder, this);
        }