I have the following Enum class
public enum EventAccess {
PUBLIC("PUBLIC"),
EMPLOYEES_ONLY("EMPLOYEES_ONLY"),
String name;
private EventAccess(String name) {
this.name = name;
}
public String getName() {
return name;
}
}
Also i have a Serializable class that that has the enum as one of its fields
public class EventAccessRequest implements Serializable{
private List<EventAccess> event_access = new ArrayList<>();
public EventAccessRequest() {
}
public List<EventAccess> getEvent_access() {
return event_access;
}
public void setEvent_access(List<EventAccess> event_access) {
this.event_access = event_access;
}
}
I have an @Api method that has creates an object the of type EventAccessRequest. I set the value of this request in the Api Explorer but it does no set any enum field i put in it.
@ApiMethod(name = "fetchEventByEventAccess", path = "user/events/list-by-access/", httpMethod = HttpMethod.GET)
public RestfulResponse fetchEventByEventAccess(EventAccessRequest request)throws Exception
{
EventAccess x = request.getEvent_access().get(0);
return new RestfulResponse(Status.SUCCESS, "Events retrieved",request, 200);
}
}
I have tried inserting other types which is not enum and it sets their value but when I try inserting an Enum in Api exploere in does not set the value. and so my request object is always empty.
What could be the problem?