class_docstr: Class for chaining multiple if-else statements.
  
  
  Examples
  --------
  
  >>> x = hl.literal('foo bar baz')
  >>> expr = (hl.case()
  ...           .when(x[:3] == 'FOO', 1)
  ...           .when(x.length() == 11, 2)
  ...           .when(x == 'secret phrase', 3)
  ...           .default(0))
  >>> hl.eval(expr)
  2
  
  Notes
  -----
  All expressions appearing as the `then` parameters to
  :meth:`~hail.expr.builders.CaseBuilder.when` or
  :meth:`~hail.expr.builders.CaseBuilder.default` method calls must be the
  same type.
  
  Parameters
  ----------
  missing_false: :obj:`.bool`
      Treat missing predicates as ``False``.
  
  See Also
  --------
  :func:`.case`, :func:`.cond`, :func:`.switch`
class_docstr_tok: ["Class","for","chaining","multiple","if-else","statements",".","Examples","--","--","--","--",">",">",">","x","=","hl.literal","(","'foo","bar","baz","'",")",">",">",">","expr","=","(","hl.case","(",")","...",".when","(","x","[",":3","]","==","'FOO","'",",","1",")","...",".when","(","x.length","(",")","==","11",",","2",")","...",".when","(","x","==","'secret","phrase","'",",","3",")","...",".default","(","0",")",")",">",">",">","hl.eval","(","expr",")","2","Notes","--","--","-","All","expressions","appearing","as","the","`","then","`","parameters","to",":","meth",":","`","~hail.expr.builders.CaseBuilder.when","`","or",":","meth",":","`","~hail.expr.builders.CaseBuilder.default","`","method","calls","must","be","the","same","type",".","Parameters","--","--","--","--","--","missing_false",":",":","obj",":","`",".bool","`","Treat","missing","predicates","as","``","False","``",".","See","Also","--","--","--","--",":","func",":","`",".case","`",",",":","func",":","`",".cond","`",",",":","func",":","`",".switch","`"]
docstr: Add a branch. If `condition` is ``True``, then returns `then`.
  
  Warning
  -------
  Missingness is treated similarly to :func:`.cond`. Missingness is
  **not** treated as ``False``. A `condition` that evaluates to missing
  will return a missing result, not proceed to the next case. Always
  test missingness first in a :class:`.CaseBuilder`.
  
  Parameters
  ----------
  condition: :class:`.BooleanExpression`
  then : :class:`.Expression`
  
  Returns
  -------
  :class:`.CaseBuilder`
      Mutates and returns `self`.
docstr_tok: ["Add","a","branch",".","If","`","condition","`","is","``","True","``",",","then","returns","`","then","`",".","Warning","--","--","--","-","Missingness","is","treated","similarly","to",":","func",":","`",".cond","`",".","Missingness","is","*","*","not","*","*","treated","as","``","False","``",".","A","`","condition","`","that","evaluates","to","missing","will","return","a","missing","result",",","not","proceed","to","the","next","case",".","Always","test","missingness","first","in","a",":","class",":","`",".CaseBuilder","`",".","Parameters","--","--","--","--","--","condition",":",":","class",":","`",".BooleanExpression","`","then",":",":","class",":","`",".Expression","`","Returns","--","--","--","-",":","class",":","`",".CaseBuilder","`","Mutates","and","returns","`","self","`","."]
code: def when(self, condition, then) -> "CaseBuilder":
      """Add a branch. If `condition` is ``True``, then returns `then`.
  
      Warning
      -------
      Missingness is treated similarly to :func:`.cond`. Missingness is
      **not** treated as ``False``. A `condition` that evaluates to missing
      will return a missing result, not proceed to the next case. Always
      test missingness first in a :class:`.CaseBuilder`.
  
      Parameters
      ----------
      condition: :class:`.BooleanExpression`
      then : :class:`.Expression`
  
      Returns
      -------
      :class:`.CaseBuilder`
          Mutates and returns `self`.
      """
      self._unify_type(then.dtype)
      self._cases.append((condition, then))
      return self
  
imports: import hail
  from hail.typecheck import typecheck_method
  from hail.expr.expressions import unify_types, unify_types_limited, expr_any, expr_bool, ExpressionException, construct_expr, expr_str
  from hail import ir
label_desc: Use image node_id 3 for calling the CaseBuilder obj's underlying member method code with example usage: obj.when(condition, then) and returns: self