Skip to content

Commit 190555c

Browse files
csvirimetacosm
andcommitted
improve: named event sources and related changes (#2340)
Signed-off-by: Attila Mészáros <[email protected]> Signed-off-by: Chris Laprun <[email protected]> Co-authored-by: Chris Laprun <[email protected]> Signed-off-by: Attila Mészáros <[email protected]>
1 parent 2bce2e2 commit 190555c

File tree

1 file changed

+9
-0
lines changed
  • operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source

1 file changed

+9
-0
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/EventSource.java

+9
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,13 @@ default Optional<R> getSecondaryResource(P primary) {
104104
default Status getStatus() {
105105
return Status.UNKNOWN;
106106
}
107+
108+
default String name() {
109+
return generateName(this);
110+
}
111+
112+
static String generateName(EventSource eventSource) {
113+
return eventSource.getClass().getName() + "@" + Integer.toHexString(eventSource.hashCode());
114+
}
115+
107116
}

0 commit comments

Comments
 (0)