Package com.squareup.javapoet
Class Util
java.lang.Object
com.squareup.javapoet.Util
Like Guava, but worse and standalone. This makes it easier to mix JavaPoet with libraries that
bring their own version of Guava.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static String
(package private) static void
checkArgument
(boolean condition, String format, Object... args) (package private) static <T> T
checkNotNull
(T reference, String format, Object... args) (package private) static void
checkState
(boolean condition, String format, Object... args) (package private) static boolean
hasDefaultModifier
(Collection<Modifier> modifiers) (package private) static <T> List<T>
immutableList
(Collection<T> collection) (package private) static <K,
V> Map<K, V> immutableMap
(Map<K, V> map) immutableMultimap
(Map<K, List<V>> multimap) (package private) static <T> Set<T>
immutableSet
(Collection<T> set) (package private) static String
(package private) static void
requireExactlyOneOf
(Set<Modifier> modifiers, Modifier... mutuallyExclusive) (package private) static String
stringLiteralWithDoubleQuotes
(String value, String indent) Returns the string literal representingvalue
, including wrapping double quotes.(package private) static <T> Set<T>
-
Field Details
-
DEFAULT
Modifier.DEFAULT doesn't exist until Java 8, but we want to run on earlier releases.
-
-
Constructor Details
-
Util
private Util()
-
-
Method Details
-
immutableMultimap
-
immutableMap
-
checkArgument
-
checkNotNull
-
checkState
-
immutableList
-
immutableSet
-
join
-
union
-
requireExactlyOneOf
-
hasDefaultModifier
-
characterLiteralWithoutSingleQuotes
-
stringLiteralWithDoubleQuotes
Returns the string literal representingvalue
, including wrapping double quotes.
-