11/*
2- * Copyright 2012-2021 the original author or authors.
2+ * Copyright 2012-2022 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
2525 */
2626public class JavaInfo {
2727
28- private final String vendor ;
29-
3028 private final String version ;
3129
30+ private final JavaVendorInfo vendor ;
31+
3232 private final JavaRuntimeEnvironmentInfo runtime ;
3333
3434 private final JavaVirtualMachineInfo jvm ;
3535
3636 public JavaInfo () {
37- this .vendor = System .getProperty ("java.vendor" );
3837 this .version = System .getProperty ("java.version" );
38+ this .vendor = new JavaVendorInfo ();
3939 this .runtime = new JavaRuntimeEnvironmentInfo ();
4040 this .jvm = new JavaVirtualMachineInfo ();
4141 }
4242
43- public String getVendor () {
44- return this .vendor ;
45- }
46-
4743 public String getVersion () {
4844 return this .version ;
4945 }
5046
47+ public JavaVendorInfo getVendor () {
48+ return this .vendor ;
49+ }
50+
5151 public JavaRuntimeEnvironmentInfo getRuntime () {
5252 return this .runtime ;
5353 }
@@ -56,6 +56,33 @@ public JavaVirtualMachineInfo getJvm() {
5656 return this .jvm ;
5757 }
5858
59+ /**
60+ * Information about the Java Vendor of the Java Runtime the application is running
61+ * in.
62+ *
63+ * @since 2.7.0
64+ */
65+ public static class JavaVendorInfo {
66+
67+ private final String name ;
68+
69+ private final String version ;
70+
71+ public JavaVendorInfo () {
72+ this .name = System .getProperty ("java.vendor" );
73+ this .version = System .getProperty ("java.vendor.version" );
74+ }
75+
76+ public String getName () {
77+ return this .name ;
78+ }
79+
80+ public String getVersion () {
81+ return this .version ;
82+ }
83+
84+ }
85+
5986 /**
6087 * Information about the Java Runtime Environment the application is running in.
6188 */
0 commit comments