Class IRStatement

java.lang.Object
org.opendaylight.yangtools.yang.ir.IRStatement
All Implemented Interfaces:
Immutable

@Beta public abstract sealed class IRStatement extends Object
A single YANG statement in its raw string form. A statement is composed of:
  • a mandatory keyword, modeled as IRKeyword
  • an optional argument, modeled as IRArgument
  • zero or more nested statements
  • Method Details

    • of

      public static @NonNull IRStatement of(IRKeyword keyword, IRArgument argument, int line, int column, ImmutableList<IRStatement> statements)
    • keyword

      public final @NonNull IRKeyword keyword()
      Return this statement's keyword.
      Returns:
      This statement's keyword.
    • argument

      public final @Nullable IRArgument argument()
      Return this statement's argument, if it is present.
      Returns:
      This statement's argument, or null if this statement does not have an argument
    • statements

      public @NonNull List<? extends IRStatement> statements()
      Return this statement's substatements.
      Returns:
      This statement's substatements.
    • startLine

      public abstract int startLine()
      Return the line number on which this statement's keyword has its first character, counting from 1. This information is used only for diagnostic purposes.
      Returns:
      Line number where this statement started in the source code.
    • startColumn

      public abstract int startColumn()
      Return the column number on which this statement's keyword has its first character, counting from 0. This information is used only for diagnostic purposes.
      Returns:
      Column number where this statement started in the source code.
    • hashCode

      public final int hashCode()
    • equals

      public final boolean equals(Object obj)
    • toString

      public final String toString()
      Overrides:
      toString in class Object