Initializing constants class from resource file: possible?

148 views Asked by At

I know that I can put my resources in a properties file and then associate class attributes to values with:

@Value("${batch-size}")
private Integer batchSize;

those values, however, are not constants so I was just wondering if it was possible to attain something like that:

public class RuntimeConstants{

        @Value("${batch-size}")
        private static final Integer batchSize; //this gives me a compiler error as java 
                                   //expects this attribute to be initialized in some way
}
0

There are 0 answers