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

com.github.zhengframework.configuration.source.SystemPropertiesConfigurationSource Maven / Gradle / Ivy

There is a newer version: 1.8.0
Show newest version
package com.github.zhengframework.configuration.source;

import com.github.zhengframework.configuration.environment.Environment;
import java.util.Collections;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;

public class SystemPropertiesConfigurationSource extends AbstractConfigurationSource {

  @Override
  public void init() {

  }

  @Override
  public Map getConfigurationInternal(Environment environment) {
    return Collections.unmodifiableMap(System.getProperties()
        .entrySet()
        .stream()
        .collect(Collectors.toMap(
            entry -> Objects.toString(entry.getKey()),
            entry -> Objects.toString(entry.getValue())
        )));
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy