Package one.pkg.tinyutils.system.info
Record Class MemoryInfo
java.lang.Object
java.lang.Record
one.pkg.tinyutils.system.info.MemoryInfo
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionMemoryInfo(long current, long total) Creates an instance of aMemoryInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongcurrent()Returns the value of thecurrentrecord component.longcurrent(MemoryInfo.Type type) final booleanIndicates whether some other object is "equal to" this one.format()formatCurrent(MemoryInfo.Type type) formatFull(MemoryInfo.Type type) longfull(MemoryInfo.Type type) static MemoryInfostatic MemoryInfodoublefinal inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.longtotal()Returns the value of thetotalrecord component.
-
Constructor Details
-
MemoryInfo
public MemoryInfo(long current, long total) Creates an instance of aMemoryInforecord class.- Parameters:
current- the value for thecurrentrecord componenttotal- the value for thetotalrecord component
-
-
Method Details
-
getSystemInstance
-
getJvmInstance
-
format
-
formatFull
-
full
-
formatCurrent
-
current
-
getUsagePercentage
public double getUsagePercentage() -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. All components in this record class are compared with '=='. -
current
public long current()Returns the value of thecurrentrecord component.- Returns:
- the value of the
currentrecord component
-
total
public long total()Returns the value of thetotalrecord component.- Returns:
- the value of the
totalrecord component
-