Hi,
I would like to choose dynamically PhotoConfiguration based on a given yml configuration file.
Example:
public interface PhotoConfiguration {}
public class FSPhotoConfiguration implements PhotoConfiguration{/* implementation */}
public class S3PhotoConfiguration implements PhotoConfiguration{/* implementation */}
And configuration
public class SampleConfiguration extends Configuration {
@Valid
@NotNull
@JsonProperty
private PhotoConfiguration photo;
public PhotoConfiguration getPhoto() {
return photo;
}
}
My yml file:
photo:
key: yyy
value: xxxx
I have checked this example [1] and tried
photo: !!example.S3PhotoConfiguration
Am I missing something?
Thanks