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

liquibase.exception.Warnings Maven / Gradle / Ivy

There is a newer version: 4.30.0
Show newest version
package liquibase.exception;

import java.util.*;

public class Warnings {

    //use linkedHashSet to keep them in order, but don't duplicate warnings that have already been logged
    private final LinkedHashSet messages = new LinkedHashSet<>();

    public Warnings addWarning(String warning) {
        messages.add(warning);
        return this;
    }

    public Warnings addAll(Warnings warnings) {
        if (warnings != null) {
            this.messages.addAll(warnings.getMessages());
        }
        return this;
    }

    public List getMessages() {
        return new ArrayList<>(messages);
    }

    public boolean hasWarnings() {
        return !messages.isEmpty();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy