You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2021/04/12 11:42:02 UTC

[GitHub] [servicecomb-java-chassis] kaister3 edited a comment on issue #2349: 微服务配置文件microservice.yaml文件中配置项参数值中存在逗号时,解析成数组。

kaister3 edited a comment on issue #2349:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2349#issuecomment-817739409


   可以用instanceof来判断是string还是list。
   
   ```java
   @SuppressWarnings("unchecked")
     public List<String> getFileSources() {
   	Object property = finalConfig.getProperty(FILE_SOURCE);
   	if (property instanceof String) {
   	  List<String> result = new ArrayList<>();
   	  result.add((String) property);
   	  return result;
   	} else if (property instanceof List) {
   	  return (List<String>) property;
   	}
   	return new ArrayList<>();
     }
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org