cfg.AndGenerator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cfg Show documentation
Show all versions of cfg Show documentation
Application configuration key management.
The newest version!
package cfg;
import java.util.ArrayList;
public class AndGenerator implements Generator {
ArrayList generators = new ArrayList();
public AndGenerator(ArrayList _generators) {
generators=_generators;
}
public void add(Generator generator) {
generators.add(generator);
}
@Override public String generate() {
StringBuilder sb = new StringBuilder();
for (Generator generator : generators) {
sb.append(generator.generate());
}
return sb.toString();
}
@Override public String toString() {
StringBuilder sb = new StringBuilder();
for (Generator generator : generators) {
if (sb.length() > 0) { sb.append("&"); }
sb.append(generator.toString());
}
return sb.toString();
}
}