【发布时间】:2017-03-05 09:12:45
【问题描述】:
我尝试过使用
@Value("#{'${white.listed.hotel.ids}'.split(',')}")
private Set<String> fareAlertwhiteListedHotelIds;
但是当 white.listed.hotel.ids 为空时,也设置了一种尺寸和空白值。
white.listed.hotel.ids =
有人可以帮我提供一个版本,其中 whiteListedHotelIds 可以包含任何值(如果在属性文件中指定)或没有用于空白大小写的项目。
【问题讨论】:
-
您的意思是在 whiteListedHotelIds 为空的情况下指定默认值吗?
-
@Georgesvanhoutte van houtte:我只是希望集合为空,以防 whiteListedHotelIds 为空。
标签: java spring spring-boot java-8 properties-file