Record Class Summary

java.lang.Object
java.lang.Record
org.geysermc.conduit.Summary
Record Components:
returned - the value returned, or null for a void method or one that never returns
assignments - the fields assigned, each once with its final value, in the order first assigned
invocations - the calls made that return nothing and could not be followed, in order

public record Summary(@Nullable Value returned, List<Summary.Assignment> assignments, List<Summary.Invocation> invocations) extends Record
What a method does from its bytecode without running it.

Values are expressed over the method's inputs, which are: Value.This, Value.Parameter, and then Value.InstanceField for a field as it was before the method ran. Branches become Value.Conditional, and a field assigned on only some paths keeps its earlier value on the others.

Summary summary = vm.summarize("com.example.Dial", "turn", null);
for (Summary.Assignment assignment : summary.assignments()) {
    System.out.println(assignment.target() + "." + assignment.field() + " = " + assignment.value());
}
  • Constructor Details

  • Method Details

    • assigned

      @Nullable public @Nullable Value assigned(@Nullable @Nullable Value target, String field)
      Finds the final value of a field assigned on an object.
      Parameters:
      target - the object, or null for a static field
      field - the field name
      Returns:
      the assigned value, or null if the method leaves it untouched
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • returned

      @Nullable public @Nullable Value returned()
      Returns the value of the returned record component.
      Returns:
      the value of the returned record component
    • assignments

      public List<Summary.Assignment> assignments()
      Returns the value of the assignments record component.
      Returns:
      the value of the assignments record component
    • invocations

      public List<Summary.Invocation> invocations()
      Returns the value of the invocations record component.
      Returns:
      the value of the invocations record component