Interface StaticImport


public interface StaticImport
A Poet static import definition to enable inclusion of static imports at code generation time
  • Method Summary

    Modifier and Type
    Method
    Description
    com.squareup.javapoet.ClassName
     
    The members to import from the class for example if memberNames() returned List("trim", "isBlank") for StringUtils.class then the following static imports would be generated: import static software.amazon.awssdk.utils.StringUtils.trim; import static software.amazon.awssdk.utils.StringUtils.isBlank;
    staticMethodImport(Class<?> clz, String... members)
    A helper implementation to create a StaticImport from a Class
  • Method Details

    • className

      com.squareup.javapoet.ClassName className()
      Returns:
      The Poet representation of the class to import (may or may not yet exist)
    • memberNames

      Iterable<String> memberNames()
      The members to import from the class for example if memberNames() returned List("trim", "isBlank") for StringUtils.class then the following static imports would be generated: import static software.amazon.awssdk.utils.StringUtils.trim; import static software.amazon.awssdk.utils.StringUtils.isBlank;
      Returns:
      The members to import from the class representation
    • staticMethodImport

      static StaticImport staticMethodImport(Class<?> clz, String... members)
      A helper implementation to create a StaticImport from a Class
      Parameters:
      clz - the class to import
      members - the members from that class to import, if none then * is assumed
      Returns:
      an anonymous implementation of StaticImport