-
Notifications
You must be signed in to change notification settings - Fork 338
Open
Description
That's a valid concern. I'm OK to remove it as this is preview feature, but it requires notice. Another option is to adding code field to explicitly set a number for the type. This is more robust so that it prevents any developer adding an event in the middle and accidentally break downstreams. It isn't a blocker for this PR though. Can you file an issue for this?
Something like:
public enum EventType {
AFTER_UPDATE(101),
AFTER_DELETE(102);
private final int code;
EventType(int code) {
this.code = code;
}
public int code() {
return code;
}
}
Adding a constructor will prevent accidental ordinal changes and make future evolution safer. Given the downstream relies on the event type, I think it's reasonable to add a explicit code.
Originally posted by @flyrain in #3195 (comment)
flyrain
Metadata
Metadata
Assignees
Labels
No labels