class_docstr: Represents a compiled pipeline with transformers and fitted models.
  
  .. versionadded:: 1.3.0
class_docstr_tok: ["Represents","a","compiled","pipeline","with","transformers","and","fitted","models",".","..","versionadded",":",":","1.3.0"]
docstr: Transfer this instance to a Java PipelineModel.  Used for ML persistence.
  
  :return: Java object equivalent to this instance.
code: def _to_java(self) -> "JavaObject":
      """
      Transfer this instance to a Java PipelineModel.  Used for ML persistence.
  
      :return: Java object equivalent to this instance.
      """
  
      gateway = SparkContext._gateway
      assert gateway is not None and SparkContext._jvm is not None
  
      cls = SparkContext._jvm.org.apache.spark.ml.Transformer
      java_stages = gateway.new_array(cls, len(self.stages))
      for idx, stage in enumerate(self.stages):
          java_stages[idx] = cast(JavaParams, stage)._to_java()
  
      _java_obj = JavaParams._new_java_obj(
          "org.apache.spark.ml.PipelineModel", self.uid, java_stages
      )
  
      return _java_obj
  
imports: import os
  from typing import Any, Dict, List, Optional, Tuple, Type, Union, cast, TYPE_CHECKING
  from pyspark import keyword_only, since, SparkContext
  from pyspark.ml.base import Estimator, Model, Transformer
  from pyspark.ml.param import Param, Params
  from pyspark.ml.util import MLReadable, MLWritable, JavaMLWriter, JavaMLReader, DefaultParamsReader, DefaultParamsWriter, MLWriter, MLReader, JavaMLReadable, JavaMLWritable
  from pyspark.ml.wrapper import JavaParams
  from pyspark.ml.common import inherit_doc
  from pyspark.sql.dataframe import DataFrame
label_desc: Use image node_id 7 for calling the PipelineModel obj's underlying member method code with example usage: obj._to_java() and returns: _java_obj