Class Hcl.Block

java.lang.Object
org.openrewrite.hcl.tree.Hcl.Block
All Implemented Interfaces:
BodyContent, Expression, Hcl, org.openrewrite.Tree
Enclosing interface:
Hcl

public static class Hcl.Block extends Object implements BodyContent, Expression
  • Constructor Details

    • Block

      public Block()
  • Method Details

    • getAttribute

      @Incubating(since="7.27.0") @Nullable public @Nullable Hcl.Attribute getAttribute(String attrName)
    • withAttributeValue

      @Incubating(since="7.27.0") public Hcl.Block withAttributeValue(String attrName, Object value)
      Locate an attribute with the given name and set its value.
      Parameters:
      attrName - The attribute to locate. This assumes there is one and only one.
      value - The value to set.
      Returns:
      This block.
    • getAttributeValue

      @Incubating(since="7.27.0") @Nullable public <T> T getAttributeValue(String attrName)
      Parameters:
      attrName - The name of the attribute to look for.
      Returns:
      The text value of the attribute matching the provided name, if any.
    • getCoordinates

      public CoordinateBuilder.Block getCoordinates()
      Specified by:
      getCoordinates in interface Expression
    • acceptHcl

      public <P> Hcl acceptHcl(HclVisitor<P> v, P p)
      Specified by:
      acceptHcl in interface Hcl
    • toString

      public String toString()
      Overrides:
      toString in class Object