class TemplateOperationsImpl
    extends HasMetadataOperation<Template, TemplateList, TemplateResource>
    implements TemplateResource,
    ParameterMixedOperation<Template, TemplateList, TemplateResource> {

  private static final Logger logger = LoggerFactory.getLogger(TemplateOperationsImpl.class);
  private static final String EXPRESSION = "expression";
  private static final TypeReference<HashMap<String, String>> MAPS_REFERENCE = new TypeReference<HashMap<String, String>>() {
  };

  private final Map<String, String> parameters;

  public TemplateOperationsImpl(Client client) {
    this(HasMetadataOperationsImpl.defaultContext(client), null);
  }

  public TemplateOperationsImpl(OperationContext context, Map<String, String> parameters) {
    super(context.withApiGroupName(TEMPLATE)
        .withPlural("templates"), Template.class, TemplateList.class);
    this.parameters = parameters;
  }

  @Override
  public TemplateOperationsImpl newInstance(OperationContext context) {
    return new TemplateOperationsImpl(context, parameters);
  }

  public TemplateOperationsImpl newInstance(OperationContext context, Map<String, String> parameters) {
    return new TemplateOperationsImpl(context, parameters == null ? null : new LinkedHashMap<>(parameters));
  }

  @Override
  public KubernetesList process(File f) {
    try (FileInputStream is = new FileInputStream(f)) {
      return process(is);
    } catch (IOException e) {
      throw KubernetesClientException.launderThrowable(forOperationType("process"), e);
    }
  }

  @Override
  public KubernetesList process(InputStream is) {
    return process(getKubernetesSerialization().unmarshal(is, MAPS_REFERENCE));
  }

  @Override
  public KubernetesList process(Map<String, String> valuesMap) {
    Template t = get();
    try {
      List<Parameter> parameters = t.getParameters();
      if (parameters != null) {
        for (Parameter p : parameters) {
          String v = valuesMap.get(p.getName());
          if (v != null) {
            p.setGenerate(null);
            p.setValue(v);
          }
        }
      }

      HttpRequest.Builder requestBuilder = this.httpClient.newHttpRequestBuilder()
          .post(JSON, getKubernetesSerialization().asJson(t))
          .url(getProcessUrl());
      t = handleResponse(requestBuilder);
      KubernetesList l = new KubernetesList();
      l.setItems(t.getObjects());
      return l;
    } catch (Exception e) {
      throw KubernetesClientException.launderThrowable(forOperationType("process"), e);
    }
  }

  @Override
  public KubernetesList process(ParameterValue... values) {
    Map<String, String> valuesMap = new HashMap<>(values.length);
    for (ParameterValue pv : values) {
      valuesMap.put(pv.getName(), pv.getValue());
    }
    return process(valuesMap);
  }

  @Override
  public KubernetesList processLocally(File f) {
    try (FileInputStream is = new FileInputStream(f)) {
      return processLocally(is);
    } catch (IOException e) {
      throw KubernetesClientException.launderThrowable(forOperationType("processLocally"), e);
    }
  }

  @Override
  public KubernetesList processLocally(InputStream is) {
    return processLocally(getKubernetesSerialization().unmarshal(is, MAPS_REFERENCE));
  }

  @Override
  public KubernetesList processLocally(ParameterValue... values) {<FILL_FUNCTION_BODY>}

  @Override
  public TemplateOperationsImpl withParameters(Map<String, String> parameters) {
    return newInstance(context, parameters);
  }

  @Override
  public KubernetesList processLocally(Map<String, String> valuesMap) {
    Template t = processParameters(getItemOrRequireFromServer());

    List<Parameter> parameters = t.getParameters();
    KubernetesList list = new KubernetesListBuilder()
        .withItems(t.getObjects())
        .build();

    String json = getKubernetesSerialization().asJson(list);
    String last = null;

    if (parameters != null && !parameters.isEmpty()) {
      while (!Objects.equals(last, json)) {
        last = json;
        for (Parameter parameter : parameters) {
          String parameterName = parameter.getName();
          String parameterValue;
          if (valuesMap.containsKey(parameterName)) {
            parameterValue = valuesMap.get(parameterName);
          } else if (Utils.isNotNullOrEmpty(parameter.getValue())) {
            parameterValue = parameter.getValue();
          } else if (EXPRESSION.equals(parameter.getGenerate())) {
            Generex generex = new Generex(parameter.getFrom());
            parameterValue = generex.random();
          } else if (parameter.getRequired() == null || !parameter.getRequired()) {
            parameterValue = "";
          } else {
            throw new IllegalArgumentException("No value available for parameter name: " + parameterName);
          }
          if (parameterValue == null) {
            logger.debug("Parameter {} has a null value", parameterName);
            parameterValue = "";
          }
          json = Utils.interpolateString(json, Collections.singletonMap(parameterName, parameterValue));
        }
      }
    }

    return getKubernetesSerialization().unmarshal(json, KubernetesList.class);
  }

  private URL getProcessUrl() throws MalformedURLException {
    return getNamespacedUrl(getNamespace(), "processedtemplates");
  }

  @Override
  public Template get() {
    return processParameters(super.get());
  }

  private Template processParameters(Template t) {
    if (this.parameters != null && !this.parameters.isEmpty()) {
      return getKubernetesSerialization()
          .unmarshal(Utils.interpolateString(getKubernetesSerialization().asJson(t), this.parameters), Template.class);
    }
    return t;
  }

  @Override
  public TemplateResource load(InputStream is) {
    Template template = null;
    List<HasMetadata> items = this.context.getClient().adapt(KubernetesClient.class).load(is).items();
    Object item = items;
    if (items.size() == 1) {
      item = items.get(0);
    }
    if (item instanceof Template) {
      template = (Template) item;
    } else {
      String generatedName = "template-" + Utils.randomString(5);
      template = new TemplateBuilder()
          .withNewMetadata()
          .withName(generatedName)
          .endMetadata()
          .withObjects(items).build();
    }

    return resource(template);
  }

}

    Map<String, String> valuesMap = new HashMap<>(values.length);
    for (ParameterValue pv : values) {
      valuesMap.put(pv.getName(), pv.getValue());
    }
    return processLocally(valuesMap);
  
<methods>public void <init>(io.fabric8.kubernetes.client.dsl.internal.OperationContext, Class<Template>, Class<TemplateList>) ,public Template accept(Consumer<Template>) ,public Template edit(UnaryOperator<Template>) ,public transient Template edit(Visitor[]) ,public Template editStatus(UnaryOperator<Template>) ,public HasMetadataOperation<Template,TemplateList,io.fabric8.openshift.client.dsl.TemplateResource> newInstance(io.fabric8.kubernetes.client.dsl.internal.OperationContext) ,public Template patch() ,public Template patch(io.fabric8.kubernetes.client.dsl.base.PatchContext) ,public Template patch(io.fabric8.kubernetes.client.dsl.base.PatchContext, Template) ,public Template patch(io.fabric8.kubernetes.client.dsl.base.PatchContext, java.lang.String) ,public Template patchStatus() ,public Template patchStatus(Template) ,public Template replace() ,public Template replaceStatus() ,public Template scale(int) ,public Template scale(int, boolean) ,public Scale scale(Scale) ,public Template update() ,public Template updateStatus() <variables>public static final long DEFAULT_GRACE_PERIOD_IN_SECONDS,public static final io.fabric8.kubernetes.api.model.DeletionPropagation DEFAULT_PROPAGATION_POLICY,private static final Logger LOGGER,private static final java.lang.String PATCH_OPERATION,private static final java.lang.String REPLACE_OPERATION,private static final java.lang.String UPDATE_OPERATION