ralscha/sse-eventbus

SseEvent.Builder::build returns ImmutableSseEvent instead of SseEvent

buckett opened this issue · 1 comments

When building an event I use

SseEvent.builder().data(data)....build();

and this returns a ImmutableSseEvent which is package private, so not accessible in the calling code. Would it not be better to have the build() call return a SseEvent? I hit this issue because autocomplete in Intellij when I ask it to assign the result of the statement to a variable attempts to create a variable of type ImmutableSseEvent.

I agree. This class should not be visible to the user of the library.

Looks like there is a solution according to the immutables documentation:
http://immutables.github.io/immutable.html#hide-implementation-class