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

org.liquibase.maven.provider.FlowCommandArgumentValueProvider Maven / Gradle / Ivy

There is a newer version: 4.30.0
Show newest version
package org.liquibase.maven.provider;

import liquibase.configuration.AbstractMapConfigurationValueProvider;

import java.util.Map;

public class FlowCommandArgumentValueProvider extends AbstractMapConfigurationValueProvider {

    private final Map args;

    public FlowCommandArgumentValueProvider(Map args) {
        this.args = args;
    }

    @Override
    public int getPrecedence() {
        return 250;
    }

    @Override
    protected Map getMap() {
        return args;
    }

    @Override
    protected String getSourceDescription() {
        return "Arguments provided through maven when invoking flow or flow.validate maven goals";
    }

    @Override
    protected boolean keyMatches(String wantedKey, String storedKey) {
        if (super.keyMatches(wantedKey, storedKey)) {
            return true;
        }
        if (wantedKey.startsWith("liquibase.command.")) {
            return super.keyMatches(wantedKey.replaceFirst("^liquibase\\.command\\.", ""), storedKey);
        }

        return super.keyMatches(wantedKey.replaceFirst("^liquibase\\.", ""), storedKey);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy