Class Util

java.lang.Object
com.squareup.javapoet.Util

final class Util extends Object
Like Guava, but worse and standalone. This makes it easier to mix JavaPoet with libraries that bring their own version of Guava.
  • Constructor Details

    • Util

      private Util()
  • Method Details

    • immutableMultimap

      static <K, V> Map<K,List<V>> immutableMultimap(Map<K,List<V>> multimap)
    • immutableMap

      static <K, V> Map<K,V> immutableMap(Map<K,V> map)
    • checkArgument

      static void checkArgument(boolean condition, String format, Object... args)
    • checkNotNull

      static <T> T checkNotNull(T reference, String format, Object... args)
    • checkState

      static void checkState(boolean condition, String format, Object... args)
    • immutableList

      static <T> List<T> immutableList(Collection<T> collection)
    • immutableSet

      static <T> Set<T> immutableSet(Collection<T> set)
    • union

      static <T> Set<T> union(Set<T> a, Set<T> b)
    • requireExactlyOneOf

      static void requireExactlyOneOf(Set<Modifier> modifiers, Modifier... mutuallyExclusive)
    • characterLiteralWithoutSingleQuotes

      static String characterLiteralWithoutSingleQuotes(char c)
    • stringLiteralWithDoubleQuotes

      static String stringLiteralWithDoubleQuotes(String value, String indent)
      Returns the string literal representing value, including wrapping double quotes.