net.linksfield.cube.partnersdk.utils.GuavaUtils Maven / Gradle / Ivy
package net.linksfield.cube.partnersdk.utils;
import com.google.common.collect.Multimap;
import java.util.Collection;
import java.util.Iterator;
/**
* @ClassName GuavaUtils
* @Description TODO
* @Author James.hu
* @Date 2023/4/12
**/
public class GuavaUtils {
public static V getMultimapFirst(Multimap map, K key) {
Collection values = map.get(key);
if (values != null) {
Iterator iterator = values.iterator();
return iterator.hasNext() ? iterator.next() : null;
} else {
return null;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy