Class Literal

java.lang.Object
org.openrewrite.java.trait.Literal
All Implemented Interfaces:
org.openrewrite.trait.Trait<Expression>

public class Literal extends Object implements org.openrewrite.trait.Trait<Expression>
A literal in Java is either a J.Literal or a J.NewArray with a non-null initializer that itself literals or new arrays that recursively contain these constraints. In other languages this trait is inclusive of constructs like list or map literals.
  • Constructor Details

    • Literal

      public Literal()
  • Method Details

    • isNull

      public boolean isNull()
    • isNotNull

      public boolean isNotNull()
    • getString

      public String getString()
    • getValue

      public <@Nullable T> T getValue(Class<@Nullable T> type)
    • getValue

      public <@Nullable T> T getValue(com.fasterxml.jackson.core.type.TypeReference<@Nullable T> type)
    • getValue

      public <@Nullable T> T getValue(com.fasterxml.jackson.databind.JavaType type)