
com.github.sviperll.maven.profiledep.resolution.ProfileCollector Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of maven-profiledep-extension Show documentation
Show all versions of maven-profiledep-extension Show documentation
Allow interdependencies between maven profiles
The newest version!
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.github.sviperll.maven.profiledep.resolution;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.maven.model.Profile;
/**
*
* @author vir
*/
class ProfileCollector {
private final List activeProfiles = new ArrayList();
private final Set activeProfilesSet = new HashSet();
ProfileCollector() {
}
private ProfileCollector(List activeProfiles, Set activeProfilesSet) {
activeProfiles.addAll(activeProfiles);
activeProfilesSet.addAll(activeProfilesSet);
}
void addAll(List profiles) {
for (Profile profile: profiles) {
add(profile);
}
}
void add(Profile profile) {
if (!activeProfilesSet.contains(profile)) {
activeProfilesSet.add(profile);
activeProfiles.add(profile);
}
}
List activeProfiles() {
List result = new ArrayList();
result.addAll(activeProfiles);
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy