本文整理汇总了Java中com.google.common.collect.ImmutableList.toArray方法的典型用法代码示例。如果您正苦于以下问题:Java ImmutableList.toArray方法的具体用法?Java ImmutableList.toArray怎么用?Java ImmutableList.toArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.common.collect.ImmutableList
的用法示例。
在下文中一共展示了ImmutableList.toArray方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: render
import com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
private static void render(StringBuilder sb, GroupedPropertyMap map, ImmutableList<String> current) {
String prefix=Strings.repeat(INDENT, current.size());
String[] array = current.toArray(new String[current.size()]);
ImmutableMap<String, Object> properties = map.propertiesOf(array);
properties.forEach((key,val) -> {
sb.append(prefix).append(INDENT).append(key).append("=").append(val).append("\n");
});
ImmutableSet<String> groups = map.groupsOf(array);
groups.forEach(g -> {
sb.append(prefix).append(INDENT).append(g).append("=").append("{\n");
render(sb,map,ImmutableList.<String>builder().addAll(current).add(g).build());
sb.append(prefix).append(INDENT).append("}\n");
});
}
示例2: withDefaultOverrides
import com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
public static ConfigOverride[] withDefaultOverrides(final ConfigOverride... configOverrides) {
ImmutableList<ConfigOverride> mergedConfigOverrides = ImmutableList.<ConfigOverride>builder()
.add(config("clientTrustStoreConfiguration.path", clientTrustStore.getAbsolutePath()))
.add(config("clientTrustStoreConfiguration.password", clientTrustStore.getPassword()))
.add(configOverrides)
.build();
return mergedConfigOverrides.toArray(new ConfigOverride[mergedConfigOverrides.size()]);
}
示例3: withDefaultOverrides
import com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
public static ConfigOverride[] withDefaultOverrides(ConfigOverride ... configOverrides) {
ImmutableList<ConfigOverride> overrides = ImmutableList.<ConfigOverride>builder()
.add(config("clientTrustStoreConfiguration.path", clientTrustStore.getAbsolutePath()))
.add(config("clientTrustStoreConfiguration.password", clientTrustStore.getPassword()))
.add(config("rpTrustStoreConfiguration.path", rpTrustStore.getAbsolutePath()))
.add(config("rpTrustStoreConfiguration.password", rpTrustStore.getPassword()))
.add(config("rootDataDirectory", FED_CONFIG_ROOT.getAbsolutePath()))
.add(configOverrides)
.build();
return overrides.toArray(new ConfigOverride[overrides.size()]);
}