Class StringOps

java.lang.Object
io.quarkus.gizmo2.creator.ops.ObjectOps
io.quarkus.gizmo2.creator.ops.StringOps
All Implemented Interfaces:
ComparableOps

public final class StringOps extends ObjectOps implements ComparableOps
Operations on String.
  • Constructor Details

    • StringOps

      public StringOps(BlockCreator bc, Expr obj)
      Construct a new instance.
      Parameters:
      bc - the block creator (must not be null)
      obj - the receiver string (must not be null)
  • Method Details

    • isEmpty

      public Expr isEmpty()
      Generate a call to String.isEmpty().
      Returns:
      the expression of the result (not null)
    • length

      public Expr length()
      Generate a call to String.length().
      Returns:
      the expression of the result (not null)
    • substring

      public Expr substring(Expr start)
      Generate a call to String.substring(int).
      Parameters:
      start - the expression of the start index (must not be null)
      Returns:
      the expression of the result (not null)
    • substring

      public Expr substring(int start)
      Generate a call to String.substring(int).
      Parameters:
      start - the start index
      Returns:
      the expression of the result (not null)
    • substring

      public Expr substring(Expr start, Expr end)
      Generate a call to String.substring(int,int).
      Parameters:
      start - the expression of the start index (must not be null)
      end - the expression of the end index (must not be null)
      Returns:
      the expression of the result (not null)
    • substring

      public Expr substring(int start, int end)
      Generate a call to String.substring(int).
      Parameters:
      start - the start index
      end - the end index
      Returns:
      the expression of the result (not null)
    • charAt

      public Expr charAt(Expr index)
      Generate a call to String.charAt(int).
      Parameters:
      index - the expression of the index (must not be null)
      Returns:
      the expression of the result (not null)
    • charAt

      public Expr charAt(int index)
      Generate a call to String.charAt(int).
      Parameters:
      index - the index
      Returns:
      the expression of the result (not null)
    • codePointAt

      public Expr codePointAt(Expr index)
      Generate a call to String.codePointAt(int).
      Parameters:
      index - the expression of the index (must not be null)
      Returns:
      the expression of the result (not null)
    • codePointAt

      public Expr codePointAt(int index)
      Generate a call to String.codePointAt(int).
      Parameters:
      index - the index
      Returns:
      the expression of the result (not null)
    • indexOf

      public Expr indexOf(Expr item)
      Parameters:
      item - the expression of the search item (must not be null)
      Returns:
      the expression of the result (not null)
    • indexOf

      public Expr indexOf(int ch)
      Generate a call to String.indexOf(int).
      Parameters:
      ch - the character to search for
      Returns:
      the expression of the result (not null)
    • indexOf

      public Expr indexOf(String str)
      Generate a call to String.indexOf(String).
      Parameters:
      str - the string to search for (must not be null)
      Returns:
      the expression of the result (not null)
    • lastIndexOf

      public Expr lastIndexOf(Expr item)
      Parameters:
      item - the expression of the search item (must not be null)
      Returns:
      the expression of the result (not null)
    • lastIndexOf

      public Expr lastIndexOf(int ch)
      Generate a call to String.lastIndexOf(int).
      Parameters:
      ch - the character to search for
      Returns:
      the expression of the result (not null)
    • lastIndexOf

      public Expr lastIndexOf(String str)
      Generate a call to String.lastIndexOf(String).
      Parameters:
      str - the string to search for (must not be null)
      Returns:
      the expression of the result (not null)
    • concat

      public Expr concat(Expr other)
      Generate a call to String.concat(String).
      Parameters:
      other - the string to concatenate to this one (must not be null)
      Returns:
      the expression of the result (not null)
    • compareTo

      public Expr compareTo(Expr other)
      Description copied from interface: ComparableOps
      Generate a call to Comparable.compareTo(Object).
      Specified by:
      compareTo in interface ComparableOps
      Parameters:
      other - the other object to compare (must not be null)
      Returns:
      the expression of the result (not null)