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

restx.AppSettingsConfig Maven / Gradle / Ivy

There is a newer version: 1.2.0-rc2
Show newest version
package restx;

import com.google.common.base.Optional;
import com.google.common.base.Strings;
import restx.common.RestxConfig;
import restx.factory.Component;

/**
 */
@Component(priority = 1000)
public class AppSettingsConfig implements AppSettings {
    private final RestxConfig config;

    public AppSettingsConfig(RestxConfig config) {
        this.config = config;
    }

    @Override
    public Optional appPackage() {
        return config.getString("restx.app.package");
    }

    @Override
    public String targetClasses() {
        return config.getString("restx.targetClasses").get();
    }

    @Override
    public String targetDependency() {
        return config.getString("restx.targetDependency").get();
    }

    @Override
    public String sourceRoots() {
        return config.getString("restx.sourceRoots").get();
    }

    @Override
    public String mainSources() {
        return config.getString("restx.mainSources").get();
    }

    @Override
    public String mainResources() {
        return config.getString("restx.mainResources").get();
    }

    @Override
    public String cachedResources() {
        return config.getString("restx.cache.cachedResources").or("");
    }

    @Override
    public Optional autoCompile() {
        return config.getBoolean("restx.router.autocompile");
    }

    @Override
    public Optional hotCompile() {
        return config.getBoolean("restx.router.hotcompile");
    }

    @Override
    public Optional hotReload() {
        return config.getBoolean("restx.router.hotreload");
    }

    @Override
    public String mode() {
        return config.getString("restx.mode").get();
    }

    @Override
    public Optional factoryLoadMode() {
        return Optional.fromNullable(Strings.emptyToNull(
                config.getString("restx.factory.load").or("")));
    }

	@Override
	public Optional coldClasses() {
		return Optional.fromNullable(Strings.emptyToNull(
				config.getString("restx.cold.classes").or("")));
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy