// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.lang.jvm.actions;

import com.intellij.lang.jvm.JvmParameter;
import org.jetbrains.annotations.NotNull;

import java.util.Collection;
import java.util.Collections;
import java.util.List;

public interface ChangeParametersRequest extends ActionRequest {

  List<ExpectedParameter> getExpectedParameters();

  /**
   * Designed to be used inside {@link JvmElementActionsFactory} implementations.
   * From the API calling side use {@link MethodRequestsKt#updateMethodParametersRequest(kotlin.jvm.functions.Function0, kotlin.jvm.functions.Function1)}
   */
  class ExistingParameterWrapper implements ExpectedParameter {

    private final JvmParameter myExistingParameter;

    public ExistingParameterWrapper(@NotNull JvmParameter existingParameter) {
      myExistingParameter = existingParameter;
    }

    @NotNull
    @Override
    public List<ExpectedType> getExpectedTypes() {
      return Collections.singletonList(new SimpleExpectedType(myExistingParameter.getType(), ExpectedType.Kind.EXACT));
    }

    @NotNull
    @Override
    public Collection<String> getSemanticNames() {
      return Collections.singletonList(myExistingParameter.getName());
    }

    @NotNull
    public JvmParameter getExistingParameter() {
      return myExistingParameter;
    }
  }

}

@@ -18,9 +18,9 @@
 -201
-8
+9
  Jet
@@ -341,16 +341,88 @@
 il.List;
+%0Aimport java.util.function.Function;%0Aimport java.util.function.Supplier;
 %0A%0Apublic
@@ -714,69 +714,26 @@
 est(
-kotlin.jvm.functions.Function0, kotlin.jvm.functions.
+Supplier, 
 Function
 1)%7D%0A
@@ -728,17 +728,16 @@
 Function
-1
 )%7D%0A   */

fix Javadoc