I have a class which has few static utility function.
I want to inject a property value << which is a static field>> without creating its bean.
@Component
class TestUtils {
@Value("${toke.value}")
public static String token;
public static String doOperation(String value) {
.... do some operation using toke
return result;
}
public static void setToken(String token ) {
TestUtils.token = token;
}
}
I am never creating object of this class. The method is called
TestUtils.doOperation(parms);
Just want to know is there is any way in which i set the property of this value , when application starts.
Thanks.