Class TryExpression

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class TryExpression extends Expression

A GtkExpression that tries to evaluate each of its expressions until it succeeds.

If all expressions fail to evaluate, the GtkTryExpression's evaluation fails as well.

Since:
4.22
  • Constructor Details

    • TryExpression

      public TryExpression(MemorySegment address)
      Create a TryExpression instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • TryExpression

      public TryExpression(@Nullable Expression @Nullable [] expressions)

      Creates a GtkExpression with an array of expressions.

      When evaluated, the GtkTryExpression tries to evaluate each of its expressions until it succeeds. If all expressions fail to evaluate, the GtkTryExpression's evaluation fails as well.

      The value type of the expressions in the array must match.

      Parameters:
      expressions - The array of expressions
      Since:
      4.22
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the TryExpression class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected TryExpression asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class Expression
      Returns:
      the instance as if it were its parent type