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

com.mailgun.util.CollectionUtil Maven / Gradle / Ivy

Go to download

The Mailgun SDK for Java enables Java developers to work with Mailgun API efficiently.

There is a newer version: 1.1.3
Show newest version
package com.mailgun.util;

import lombok.experimental.UtilityClass;

import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.Objects;
import java.util.Set;

@UtilityClass
public class CollectionUtil {

    public  Set addToSet(Set internalSet, T provideValue) {
        if (Objects.isNull(internalSet)) {
            internalSet = new LinkedHashSet<>();
        }
        internalSet.add(provideValue);
        return internalSet;
    }

    public  Set addToSet(Set internalSet, Collection provideValues) {
        if (Objects.isNull(internalSet)) {
            internalSet = new LinkedHashSet<>();
        }
        internalSet.addAll(provideValues);
        return internalSet;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy