本文整理匯總了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()]);
}