'how to convert setter to List when the parameter is not list?

The reason for not using List<Integer> purchase_item_cart because of problem in mybatis mapping and the solution i can think of is convert it to List

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Client {
    
    private Integer client_guest_id;
    private String client_guest_name;
    private String client_guest_email;
    
    private Integer purchase_item_cart;
    private ProductEntity productEntity;
    
    }

I dont know how to convert setter purchase_item_cart to List


    
    public List<Integer> returnasList(Integer integer){
        
        
        
        
        return null;
        
        
    }



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source