Top "Guava" questions

Google's Core Java Library for Java and Android development.

Lists.newArrayList vs new ArrayList

What is the best construction for creating a List of Strings? Is it Lists.newArrayList() (from guava) or new ArrayList()? …

java generics guava
Get empty string when null

I want to get string values of my fields (they can be type of long string or any object), if …

java guava
How to transform List<X> to another List<Y>

I have two lists of objects; List<X> and List<Y>. X and Y are ojects …

java list transform guava
How to make a new list with a property of an object which is in another list

Imagine that I have a list of certain objects: List<Student> And I need to generate another list …

java list collections java-stream guava
Error:com.android.builder.dexing.DexArchiveBuilderException: Failed to process guava-21.0.jar Android 3.1 Dev Channel

After updating my dependency versions in AndroidStudio3.1, I started getting the following error: Information:Gradle tasks [:app:assembleDebug] Error:com.…

android android-gradle-plugin guava android-studio-3.0
Google Guava isNullOrEmpty for collections

I see that Guava has isNullOrEmpty utility method for Strings Strings.isNullOrEmpty(str) Do we have anything similar for Lists? …

java guava
How to create a Multimap<K,V> from a Map<K, Collection<V>>?

I didn't find such a multimap construction... When I want to do this, I iterate over the map, and populate …

java guava multimap
Sort List in reverse in order

I have List list1 in direct order. List<String> list = Ordering.natural().sortedCopy(asu2); How to change order. …

java list sorting guava
filtering an ArrayList using an object's field

I have an ArrayList which is filled by Objects. My object class called Article which has two fields ; public class …

java arraylist filtering guava
Guava equivalent for IOUtils.toString(InputStream)

Apache Commons IO has a nice convenience method IOUtils.toString() to read an InputStream to a String. Since I am …

java io inputstream guava