Record Class RuntimeInfo
java.lang.Object
java.lang.Record
cloud.opencode.base.core.system.RuntimeInfo
- Record Components:
javaVersion- Java runtime version string - Java 运行时版本字符串javaVendor- Java vendor - Java 厂商javaHome- Java home directory - Java 安装目录vmName- VM implementation name - VM 实现名称vmVersion- VM implementation version - VM 实现版本uptime- JVM uptime in milliseconds - JVM 运行时间(毫秒)startTime- JVM start time as epoch milliseconds - JVM 启动时间(毫秒时间戳)pid- process ID - 进程 IDinputArguments- JVM input arguments (unmodifiable) - JVM 输入参数(不可修改)
public record RuntimeInfo(String javaVersion, String javaVendor, String javaHome, String vmName, String vmVersion, long uptime, long startTime, long pid, List<String> inputArguments)
extends Record
Immutable snapshot of JVM runtime information.
JVM 运行时信息的不可变快照。
Captures JVM version, vendor, VM details, uptime, and startup arguments at the time of creation.
捕获创建时的 JVM 版本、厂商、VM 详情、运行时间和启动参数。
Usage Examples | 使用示例:
RuntimeInfo rt = SystemInfo.runtime();
System.out.println("Java: " + rt.javaVersion());
System.out.println("VM: " + rt.vmName() + " " + rt.vmVersion());
System.out.println("Uptime: " + rt.uptime() + " ms");
System.out.println("PID: " + rt.pid());
- Since:
- JDK 25, opencode-base-core V1.0.3
- Author:
- Leon Soo
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theinputArgumentsrecord component.javaHome()Returns the value of thejavaHomerecord component.Returns the value of thejavaVendorrecord component.Returns the value of thejavaVersionrecord component.longpid()Returns the value of thepidrecord component.longReturns the value of thestartTimerecord component.final StringtoString()Returns a string representation of this record class.longuptime()Returns the value of theuptimerecord component.vmName()Returns the value of thevmNamerecord component.Returns the value of thevmVersionrecord component.
-
Constructor Details
-
RuntimeInfo
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
javaVersion
Returns the value of thejavaVersionrecord component.- Returns:
- the value of the
javaVersionrecord component
-
javaVendor
Returns the value of thejavaVendorrecord component.- Returns:
- the value of the
javaVendorrecord component
-
javaHome
-
vmName
-
vmVersion
-
uptime
-
startTime
-
pid
-
inputArguments
Returns the value of theinputArgumentsrecord component.- Returns:
- the value of the
inputArgumentsrecord component
-