com.jzallas.lifecycleaware.compiler.Utils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lifecycleaware-compiler Show documentation
Show all versions of lifecycleaware-compiler Show documentation
Annotation based triggers that automatically hook observers into the Android lifecycle.
The newest version!
package com.jzallas.lifecycleaware.compiler;
import com.squareup.javapoet.CodeBlock;
import java.util.HashSet;
import java.util.Set;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collector;
import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.TypeMirror;
import javax.lang.model.util.Elements;
import javax.lang.model.util.Types;
public class Utils {
/**
* Convenience method to help filtering distinct items in a {@link java.util.stream.Stream} by the provided {@link Predicate}
*
* @param keyExtractor function that generates a key from {@link T}
* @param
* @return {@link Predicate} to be used with {@link java.util.stream.Stream#filter(Predicate)}
*/
public static Predicate distinctByKey(Function super T, ?> keyExtractor) {
Set
© 2015 - 2024 Weber Informatics LLC | Privacy Policy