org.xblackcat.sjpu.storage.consumer.ToEnumSetConsumer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sjpu-dbah Show documentation
Show all versions of sjpu-dbah Show documentation
Service for generating DB access logic in simple way via interfaces and annotations
package org.xblackcat.sjpu.storage.consumer;
import java.util.EnumSet;
import java.util.Set;
/**
* Consume all objects into {@linkplain java.util.EnumSet EnumSet}. Input objects should be enum constants of the same Enum object
*
* @author xBlackCat
*/
public class ToEnumSetConsumer> implements IRowSetConsumer, E> {
private final EnumSet set;
public ToEnumSetConsumer(Class clazz) {
set = EnumSet.noneOf(clazz);
}
@Override
public boolean consume(E o) {
set.add(o);
return false;
}
public EnumSet getRowsHolder() {
return set;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy