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

org.xblackcat.sjpu.storage.consumer.ToEnumSetConsumer Maven / Gradle / Ivy

Go to download

Service for generating DB access logic in simple way via interfaces and annotations

There is a newer version: 2.0
Show newest version
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