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

Ability to generate of() methods for single field types #36

Open
alexander-yevsyukov opened this issue Jan 30, 2018 · 5 comments
Open
Labels
/Compiler enhancement New feature or request

Comments

@alexander-yevsyukov
Copy link
Contributor

Similarly to StringValue.of(), UInt32.of() we need to have of() methods generated for single-field types.

It would be really convenient for ID types and single value types like Email, PhoneNumber etc.

@alexander-yevsyukov
Copy link
Contributor Author

@armiol, FYI.

@dmdashenkov
Copy link
Contributor

It seems that the feature is available for a limited number of types only.

I've created an issue to track this matter.

@alexander-yevsyukov
Copy link
Contributor Author

alexander-yevsyukov commented Feb 1, 2018

@dmdashenkov, they already replied, and reasonably say that they cannot give this feature for user types, as they don't have control that there would be only one field.

Please close the issue you created. And let's discuss how we can do it ourselves.

@alexander-yevsyukov alexander-yevsyukov added enhancement New feature or request /Compiler labels Feb 1, 2018
@alexander-yevsyukov
Copy link
Contributor Author

@yuri-sergiichuk, please look into this issue once you finish current works on method factories.

Presumably, we need a selector, which would accept all types with one field, excluding those which are UuidValue (since they are generated and are not supposed to be constructed manually).

@alexander-yevsyukov
Copy link
Contributor Author

@yuri-sergiichuk, we also probably need some kind of “sealing” such types, saying: “There will be always one field in this type”. Having just one field is not enough.

@alexander-yevsyukov alexander-yevsyukov transferred this issue from SpineEventEngine/base Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
/Compiler enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants