All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.simpleflatmapper.util.SetCollector Maven / Gradle / Ivy

Go to download

Java library to map flat record - ResultSet, csv - to java object with minimum configuration and low footprint.

The newest version!
package org.simpleflatmapper.util;

import java.util.HashSet;
import java.util.Set;

/**
 * Implementation of {@link Consumer} that collect all the value into a set.

* Equivalent to a {@link java.util.stream.Collectors#toSet()}. * @param the type of the callback argument */ public final class SetCollector implements Consumer { private final Set set = new HashSet(); @Override public void accept(final T t) { set.add(t); } /** * * @return the collected objects */ public Set getSet() { return set; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy