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

problems using set and get key-value pair of MVCObject #220

Open
F43RY opened this issue Sep 15, 2014 · 1 comment
Open

problems using set and get key-value pair of MVCObject #220

F43RY opened this issue Sep 15, 2014 · 1 comment

Comments

@F43RY
Copy link

F43RY commented Sep 15, 2014

Hi, I've a problem trying to set a String value in polygons, circles and Objects extending MVCObject.
I'd like to use
polygon.set("myVar", "myValue"); or polygon.set("myVar", myNumber);
and
String myString = polygon.get("myVar); or Number myNumber = polygon.get("myVar");
but I only can use
polygon.set("myVar", otherPolygon);
and
Polygon p = polygon.get("myVar");
this has no sense for me because I'd generate a hyerarchy of nested polygons but I cannot set a simple variable in none of them.
I tried to use
polygon.setValues(HashMap<String, String> map),
but the getter method doesn't get any value.

@F43RY
Copy link
Author

F43RY commented Sep 16, 2014

The code at the link below fix the issue:
#188 (comment)
Is it possible ti merge the code in the master?

This is the main side of the comment:
The signature of set(String, T) should probably be changed to set(String, Object)
The signature of T get(String) should maybe be something like public final native U get(String), but I'll admit my grasp of generics is not 100% and I'm not so confident on this one.
setValues(HashMap<String,String>) should probably become setValues(Map<String,?>).

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