java.lang.Object
org.phenopackets.phenopackettools.util.message.MessageUtils

public class MessageUtils extends Object
A class with utility functions for working with protobuf messages.
  • Method Details

    • findInstancesOfType

      public static <T> Stream<T> findInstancesOfType(com.google.protobuf.MessageOrBuilder message, Class<T> clz)
      Find all instances of MessageUtils in a given message.

      Protobuf messages are hierarchical structures where, depending on the schema, a component may be present at different places of the hierarchy. This function will stream all instances of the requested class.

      Type Parameters:
      T - type of the target class
      Parameters:
      message - protobuf message to search in
      clz - target class
      Returns:
      a Stream of all MessageUtilss found in the message