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

com.societegenerale.commons.plugin.maven.model.MavenRules Maven / Gradle / Ivy

package com.societegenerale.commons.plugin.maven.model;

import java.util.ArrayList;
import java.util.List;

import com.societegenerale.commons.plugin.model.Rules;
import org.apache.maven.plugins.annotations.Parameter;

import static java.util.stream.Collectors.toList;

public class MavenRules {

    @Parameter(property = "preConfiguredRules")
    private List preConfiguredRules= new ArrayList<>();

    @Parameter(property = "configurableRules")
    private List configurableRules = new ArrayList<>();

    public MavenRules() {
        //no arg constructor required by Maven when running the plugin
    }

    public MavenRules(List preConfiguredRules, List configurableRules) {
        this.preConfiguredRules = preConfiguredRules;
        this.configurableRules = configurableRules;
    }

    public Rules toCoreRules(){

        return new Rules(preConfiguredRules,
                configurableRules.stream()
                                 .map(e -> e.toCoreConfigurableRule())
                                 .collect(toList()));
    }

    public List getPreConfiguredRules() {
        return preConfiguredRules;
    }

    public List getConfigurableRules() {
        return configurableRules;
    }

    public void setPreConfiguredRules(List preConfiguredRules) {
        this.preConfiguredRules = preConfiguredRules;
    }

    public void setConfigurableRules(List configurableRules) {
        this.configurableRules = configurableRules;
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy