package com.dairymoose.modernlife.core;

import java.util.HashSet;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/* loaded from: outputsrg.jar:com/dairymoose/modernlife/core/CsvSourcedHashSet.class */
public class CsvSourcedHashSet extends HashSet<String> {
    private static final long serialVersionUID = 5081837333271002941L;
    private static final Logger LOGGER = LogManager.getLogger();

    public CsvSourcedHashSet(String csvText) {
        String[] split;
        ModernLifeCommon.LOGGER.debug("Loading CSV HashSet");
        if (StringUtils.isBlank(csvText) || (split = csvText.split(",")) == null || split.length == 0) {
            return;
        }
        StringBuilder result = new StringBuilder();
        boolean first = true;
        for (String datum : split) {
            if (StringUtils.isNotBlank(datum)) {
                if (!first) {
                    result.append(", ");
                } else {
                    first = false;
                }
                result.append(datum);
                add(datum);
            }
        }
        ModernLifeCommon.LOGGER.debug("Parsed CSV = " + result.toString());
    }
}
