Class MessageUtils
java.lang.Object
org.phenopackets.phenopackettools.util.message.MessageUtils
A class with utility functions for working with protobuf messages.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Stream<T>
findInstancesOfType
(com.google.protobuf.MessageOrBuilder message, Class<T> clz) Find all instances ofMessageUtils
in a givenmessage
.
-
Method Details
-
findInstancesOfType
public static <T> Stream<T> findInstancesOfType(com.google.protobuf.MessageOrBuilder message, Class<T> clz) Find all instances ofMessageUtils
in a givenmessage
.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 inclz
- target class- Returns:
- a Stream of all
MessageUtils
s found in themessage
-