make tostring method to return variable names of class or jersey @QueryParam name

I’m using Jersey to make my life easier for routing and I’m also using the @BeanParam to make the filtering simper. But i want to make a query to DB and make dynamic query. Something like this inside of a service class

segment in service class

        if (filterBean.getUserId() > 0) {
            //TODO add criteria to query if userId set && !=0
  "userId"), filterBean.getUserId()));
            //<========instead something like this:
            builder.equal(root.get(filterBean.getUserIdName), filterBean.getUserId()

routing class

        public List<TradeMessage> getTradeMessage(@BeanParam TradeMessageFilterBean filterBean) {
        . . .

TradeMessageFilterBean class

        public class TradeMessageFilterBean {

            private @QueryParam("start") int start;
            private @QueryParam("size") int size;
            private @QueryParam("userId") int userId

                public String getStartName() {//TODO remove
                return this.getClass().getSimpleName();// <======== here i want to return userId

            public int getUserId() {        
                return userId;

            . . .