Package winterwell.utils

Examples of winterwell.utils.Environment


  static {
    Environment.putDefault(KEY_VERSION, new Version());
  }

  public static String getVersion() {
    Environment env = Environment.get();
    Version v = env.get(KEY_VERSION);
    if (v.props.length == 0)
      return "";
    // special case for only one bit of versioning info
    if (v.props.length == 1)
      return "v" + Printer.toString(env.get(v.props[0]));
    StringBuilder sb = new StringBuilder();
    sb.append("v");
    for (Key k : v.props) {
      Object value = env.get(k);
      assert value != null : k;
      String kv = value.toString();
      sb.append(k + "=" + kv.replace('_', '-') + "_");
    }
    StrUtils.pop(sb, 1);
View Full Code Here

TOP

Related Classes of winterwell.utils.Environment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.