I'm Working on project and I have this problem:
The method setCategory(TypeCategory) in the type Client is not applicable for the arguments (String)
This is my code:
Enum class
public enum TypeCategory {
Private ,
Public ;
}
Bean class
public List<Client>getRessourcesList2s(){
clientSk sk = new clientSk(2);
ArrayList<Client> listeUsers= new ArrayList<>();
try {
JSONArray json = clientSk.readJsonFromUrl("http://localhost:22033/API/Affichage");
for (int i = 0, count = json.length(); i < count; i++) {
Client s = new Client();
JSONObject obj = (JSONObject)json.get(i);
s.setCategory(obj.get("category").toString());
listeUsers.add(s);
}
System.out.println(listeUsers);
} catch (IOException e) {
e.printStackTrace();
} catch (JSONException e) {
e.printStackTrace();
}
return (listeUsers);
}
My problem with this:
s.setCategory(obj.get("category").toString());
I don't know what to do ?