Class This

java.lang.Object
io.sundr.model.This
All Implemented Interfaces:
Expression, Node, Renderable, WithReferences

public class This extends Object implements Expression
  • Constructor Details

    • This

      public This()
  • Method Details

    • ref

      public static FieldRef ref(String name)
    • ref

      public static FieldRef ref(Field field)
    • construct

      public static MethodCall construct(Expression... arguments)
      Creates a this constructor delegation, rendered as this(...). This is distinct from calling a method on this, which is this.name(...).
      Parameters:
      arguments - the constructor arguments
      Returns:
      the constructor delegation call
    • construct

      public static MethodCall construct(List<? extends Expression> arguments)
      Creates a this constructor delegation, rendered as this(...).
      Parameters:
      arguments - the constructor arguments
      Returns:
      the constructor delegation call
    • construct

      public static MethodCall construct(Object... arguments)
      Creates a this constructor delegation, accepting literal values in place of expressions. Literals are wrapped in a ValueRef, expressions are used as is.
      Parameters:
      arguments - the constructor arguments, each a literal or an expression
      Returns:
      the constructor delegation call
    • render

      public String render()
      Description copied from interface: Renderable
      Render the type into a String for the purpose of code generation. This is slightly different from the `toString()` method as `toString()` is mostly needed for logging / debugging and should be idempotent. Regarding idempotency this method may yield different result based on the context it is used even if the internal state of the object does not change. An example of such case, is a reference to class that may change based on the package from which it's refenced.
      Specified by:
      render in interface Renderable
      Returns:
      the String representation of the object as it's meant to appear in the generated code.