I have a constant class and I'm trying to set a batch number constant at run time with public static final String. My IDE is giving me a warning "static method declared final" and I'd like to know if I'm doing something incorrectly.
file gets value from Spring yml file.
private String file; (xxx-12345.txt)
public String getBatchNo() {
return parseBatchNo(file);
}
public static final String parseBatchNo(String file) {
return file.substring((file.lastIndexOf("-") + 1), (file.length() - 4));
}