Skip to content

Commit f681ff1

Browse files
committed
Add Ops.info() convenience
1 parent 24e52a6 commit f681ff1

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

  • scijava/scijava-ops-api/src/main/java/org/scijava/ops/api

‎scijava/scijava-ops-api/src/main/java/org/scijava/ops/api/Ops.java‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ public static <T> RichOp<T> rich(T op) {
5757
return (RichOp<T>) op;
5858
}
5959

60+
/**
61+
* Convenience function for getting the {@link OpInfo} of {@code op}
62+
* @param op the Op
63+
* @return the {@link OpInfo} that generated {@code op}
64+
* @param <T> the type of {@code op}
65+
*/
66+
public static <T> OpInfo info(T op) {
67+
return rich(op).instance().infoTree().info();
68+
}
69+
6070
/**
6171
* Convenience function for accessing {@link RichOp#recordExecutions(boolean)}
6272
*

0 commit comments

Comments
 (0)