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

org.coderu.plugins.maven.utils.CoderuConfiguration Maven / Gradle / Ivy

package org.coderu.plugins.maven.utils;

import java.util.Collection;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.coderu.core.api.CompileUnit;
import org.coderu.core.api.Depth;
import org.coderu.core.api.Packagge;

public final class CoderuConfiguration {

    public Collection getCompileUnit() {
        return compileUnit;
    }

    public Collection getComponents() {
        return components;
    }

    public Collection getExcluded() {
        return excluded;
    }

    public Depth getCalculatedDepth() {
        return calculatedDepth;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
                .append(compileUnit).append(components).append(excluded)
                .append(calculatedDepth).toString();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder(3, 21).append(compileUnit)
                .append(components).append(excluded).append(calculatedDepth)
                .toHashCode();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;

        final CoderuConfiguration other = (CoderuConfiguration) obj;

        return new EqualsBuilder().append(compileUnit, other.compileUnit)
                .append(components, other.components)
                .append(excluded, other.excluded)
                .append(calculatedDepth, other.calculatedDepth).isEquals();
    }

    public CoderuConfiguration(final Collection compileUnit,
            final Collection components,
            final Collection excluded, final Depth calculatedDepth) {

        this.compileUnit = CompileUnit.ORDERING
                .immutableSortedCopy(compileUnit);
        this.components = Packagge.ORDERING.immutableSortedCopy(components);
        this.excluded = Packagge.ORDERING.immutableSortedCopy(excluded);
        this.calculatedDepth = calculatedDepth;
    }

    final Collection compileUnit;
    final Collection components;
    final Collection excluded;
    final Depth calculatedDepth;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy