package com.tngtech.configbuilder.configuration;

import com.tngtech.configbuilder.annotation.valueextractor.*;
import org.apache.commons.cli.CommandLine;

import java.lang.annotation.Annotation;
import java.util.Properties;

/**
 * Stores the configuration for the ConfigBuilder, i.e. the CommandLine, the Properties and the global annotation processing order.
 */
public class BuilderConfiguration {

    private Properties properties;
    private CommandLine commandLine;
    private Object importedConfiguration;
    private Class<? extends Annotation>[] annotationOrder = new Class[]{CommandLineValue.class, PropertyValue.class, EnvironmentVariableValue.class, SystemPropertyValue.class, ImportedValue.class, DefaultValue.class};
    private String[] propertyNamePrefixes = new String[]{""};

    public BuilderConfiguration() {
        properties = new Properties();
        commandLine = null;
        importedConfiguration = null;
    }

    public CommandLine getCommandLine() {
        return commandLine;
    }

    public Properties getProperties() {
        return properties;
    }

    public Object getImportedConfiguration() {
        return importedConfiguration;
    }

    public void setProperties(Properties properties) {
        this.properties = properties;
    }

    public void setCommandLine(CommandLine commandLine) {
        this.commandLine = commandLine;
    }

    public void setImportedConfiguration(Object importedConfiguration) {
        this.importedConfiguration = importedConfiguration;
    }

    public void setAnnotationOrder(Class<? extends Annotation>[] annotationOrder) {
        this.annotationOrder = annotationOrder;
    }

    public Class<? extends Annotation>[] getAnnotationOrder() {
        return annotationOrder;
    }

    public void setPropertyNamePrefixes(String[] propertyNamePrefixes) {
        this.propertyNamePrefixes = propertyNamePrefixes;
    }

    public String[] getPropertyNamePrefixes() {
        return propertyNamePrefixes;
    }
}

@@ -425,24 +425,43 @@
 s properties
+ = new Properties()
 ;%0A    privat
@@ -481,24 +481,31 @@
  commandLine
+ = null
 ;%0A    privat
@@ -530,24 +530,31 @@
 onfiguration
+ = null
 ;%0A    privat
@@ -828,156 +828,8 @@
 %7D;%0A%0A
-    public BuilderConfiguration() %7B%0A        properties = new Properties();%0A        commandLine = null;%0A        importedConfiguration = null;%0A    %7D%0A%0A
     

simplify BuilderConfiguration initialization