Skip to content

Commit

Permalink
preparation for release 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pz2 committed Feb 21, 2024
1 parent 05f8554 commit 6584f88
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 5 deletions.
13 changes: 13 additions & 0 deletions hofund-core/src/main/java/dev/logchange/hofund/StringUtils.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package dev.logchange.hofund;

public class StringUtils {

public static String emptyIfNull(String val) {
if (val == null) {
return "";
} else {
return val;
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import static dev.logchange.hofund.StringUtils.emptyIfNull;

@Getter
@Builder(access = AccessLevel.PRIVATE)
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
Expand All @@ -27,9 +29,6 @@ public static HofundJavaInfo get() {
}




@Getter
public static class JavaVendorInfo {

private final String name;
Expand All @@ -40,9 +39,17 @@ public JavaVendorInfo() {
this.name = System.getProperty("java.vendor");
this.version = System.getProperty("java.vendor.version");
}

public String getName() {
return emptyIfNull(name);
}

public String getVersion() {
return emptyIfNull(version);
}
}

@Getter

public static class JavaRuntimeEnvironmentInfo {

private final String name;
Expand All @@ -53,9 +60,16 @@ public JavaRuntimeEnvironmentInfo() {
this.name = System.getProperty("java.runtime.name");
this.version = System.getProperty("java.runtime.version");
}

public String getName() {
return emptyIfNull(name);
}

public String getVersion() {
return emptyIfNull(version);
}
}

@Getter
public static class JavaVirtualMachineInfo {

private final String name;
Expand All @@ -69,6 +83,18 @@ public JavaVirtualMachineInfo() {
this.vendor = System.getProperty("java.vm.vendor");
this.version = System.getProperty("java.vm.version");
}

public String getName() {
return emptyIfNull(name);
}

public String getVendor() {
return emptyIfNull(vendor);
}

public String getVersion() {
return emptyIfNull(version);
}
}

}
Expand Down

0 comments on commit 6584f88

Please sign in to comment.