Serialization of generic types - GWT

Posted by sarav on Stack Overflow See other posts from Stack Overflow or by sarav
Published on 2010-04-24T12:52:46Z Indexed on 2010/04/24 12:53 UTC
Read the original article Hit count: 221

Filed under:
|
|
|

I have an interface like this

public interface IField<T> extends IsSerializable {
public  String getKey();
public void setKey(String name);
public T getValue();
public void setValue(T role); }

And a class like this

public class FieldImpl<T> implements IField<T> {
private String key;
public String getKey() {
    return key;
}
public void setKey(String key) {
    this.key = key;
}
public T getValue() {
    return value;
}
public void setValue(T value) {
    this.value = value;
}
private T value;

public FieldImpl() {
}

public FieldImpl(String key, T value) {
super();
this.key = key;
this.value = value;
} }

When I try to compile I'm getting

[ERROR] In order to produce smaller client-side code, 'Object' is not allowed; please use a more specific type (reached via server.sdk.model.IField)

What is the cause for this? Is there any place I can read about GWT's generics support?

© Stack Overflow or respective owner

Related posts about gwt

Related posts about serialization