Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KEYCLOAK-3618: Extensible ResourceType for provider-created AdminEvents #3316

Closed
wants to merge 1 commit into from

Conversation

dteleguin
Copy link
Contributor

The implementation is based on the extensible enum pattern. It requires that the enum implement an interface (an empty one in our case).

There were two options for refactoring:

  1. leave ResourceType as is, introduce IResourceType:
    public enum ResourceType implements IResourceType
    This mostly requires changes to imports and method signatures (about 20 code locations), but introduces that ugly IResourceType. ResourceType enum fields are referenced just like before, with ResourceType.of("FOO") used to obtain custom value;

  2. make ResourceType interface, rename ResourceType to something like StandardResourceType:
    public enum StandardResourceType implements ResourceType
    This would require changes to all the enum field references (~100 locations).

I've implemented the first variant because of its relative simplicity. Please let me know if the second variant is preferable, I'll reimplement the PR.

@stianst
Copy link
Contributor

stianst commented Oct 18, 2016

I'm going to close this. We can't have static methods exposed on random classes. This is not a good approach.

@stianst stianst closed this Oct 18, 2016
@dteleguin dteleguin deleted the KEYCLOAK-3618 branch November 28, 2019 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants