In our project we haven't Spring, so work like can with that. I found that we have many repetable code. We have something like that in 5 or more classes
import javax.ws.rs.DefaultValue;
import javax.ws.rs.QueryParam;
@Data
public class QueryParamDto {
@DefaultValue("1");
@QueryParam("sortBy")
private String sortBy;
@DefaultValue("ASC");
@QueryParam("sortDir")
private String sortDir;
...
}
And it would be good to create something like BaseDto class with common fields, but in some classes we have different DefaultValue like
@Data
public class KeywordsDto {
@DefaultValue("5");
@QueryParam("sortBy")
private String sortBy;
...
}
Because of that 'sortBy' can not be coommon fields with common value = 1 from BaseDto.
Maybe there is some variant to oveeride child's fields?