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

Generating constants #7

Open
kiddikai opened this issue May 24, 2015 · 0 comments
Open

Generating constants #7

kiddikai opened this issue May 24, 2015 · 0 comments

Comments

@kiddikai
Copy link

This works as expected, yielding a private int GAMEFIELD_WIDTH with getter and setter:

game.createAttribute("GAMEFIELD_WIDTH", DataType.INT)
.withInitialization("20");

This will generate a public final int GAMEFIELD_WIDTH without a getter, while the class' toString() still attempts to call it:

game.createAttribute("GAMEFIELD_WIDTH", DataType.INT)
.withInitialization("20")
.with(Visibility.FINAL); // kills the getter

Furthermore, this will get you a public static int GAMEFIELD_WIDTH instead of a public static final int:

game.createAttribute("GAMEFIELD_WIDTH", DataType.INT)
.withInitialization("20")
.with(Visibility.FINAL)
.with(Visibility.STATIC); // kills the final modifier
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

No branches or pull requests

1 participant