getProperty()有四种重载的变种形式:
- String getProperty(String key)
- String getProperty(String key, String defaultValue)
- T getProperty(String key, Class<T> type)
- T getProperty(String key, Class<T> type, T defaultValue)
检查哪些profile处于激活状态:
- String[] getActiveProfiles():返回激活profile名称的数组;
- Stirng[] getDefaultProfiles():返回默认profile名称的数组;
- boolean acceptsProfiles(String... profiles)"如果Environment支持给定profile的话,就返回true。
网友评论