Saturday, 21 May 2016

Java: Owner: Importing System properties

import org.aeonbits.owner.Config;

public interface ProjectConfig extends Config {

  @DefaultValue("No mapping exisits")
  @Key("HOME")
  String home();

  @DefaultValue("No mapping exisits")
  @Key("SHELL")
  String shell();

  @DefaultValue("No mapping exisits")
  @Key("USER")
  String user();

  @DefaultValue("No mapping exisits")
  @Key("TMPDIR")
  String tmpDir();

  @DefaultValue("No mapping exisits")
  @Key("file.separator")
  String separator();

}

import org.aeonbits.owner.Config;

public interface ProjectConfig extends Config {

  @DefaultValue("No mapping exisits")
  @Key("HOME")
  String home();

  @DefaultValue("No mapping exisits")
  @Key("SHELL")
  String shell();

  @DefaultValue("No mapping exisits")
  @Key("USER")
  String user();

  @DefaultValue("No mapping exisits")
  @Key("TMPDIR")
  String tmpDir();

  @DefaultValue("No mapping exisits")
  @Key("file.separator")
  String separator();

}


Output
/Users/harikrishna_gurram
/
/bin/bash
/var/folders/1x/9q4yr4k15csf564llfcz3c1h7n6wlv/T/
harikrishna_gurram


Previous                                                 Next                                                 Home

No comments:

Post a Comment