net.roboconf.core.utils.Utils.format()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(102)

本文整理了Java中net.roboconf.core.utils.Utils.format()方法的一些代码示例,展示了Utils.format()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.format()方法的具体详情如下:
包路径:net.roboconf.core.utils.Utils
类名称:Utils
方法名:format

Utils.format介绍

[英]Formats a collection of elements as a string.
[中]将元素集合格式化为字符串。

代码示例

代码示例来源:origin: net.roboconf/roboconf-dm

@Override
public void removeFromList( String key, String value ) throws IOException {
  Collection<String> values = getPreferencesAsCollection( key );
  values.remove( value );
  save( key, Utils.format( values, ", " ));
}

代码示例来源:origin: net.roboconf/roboconf-dm

@Override
public void addToList( String key, String value ) throws IOException {
  Collection<String> values = getPreferencesAsCollection( key );
  values.add( value );
  save( key, Utils.format( values, ", " ));
}

代码示例来源:origin: roboconf/roboconf-platform

properties.setProperty( APPLICATION_EXTERNAL_EXPORTS, sb.toString());
properties.setProperty( APPLICATION_TAGS, Utils.format( descriptor.tags, ", " ));
Utils.writePropertiesFile( properties, f );

代码示例来源:origin: net.roboconf/roboconf-dm

String s = Utils.format( entry.getValue(), ", " );
format.put( entry.getKey(), s );

代码示例来源:origin: roboconf/roboconf-platform

@Test
public void testFormat() {
  List<String> list = Arrays.asList( "1", "2", "", "3", "4" );
  Assert.assertEquals( "1, 2, , 3, 4", Utils.format( list, ", " ));
  Assert.assertEquals( "1 - 2 -  - 3 - 4", Utils.format( list, " - " ));
}

代码示例来源:origin: roboconf/roboconf-platform

String s = Utils.format( instance.channels, ", " );
p = new BlockProperty( file, ParsingConstants.PROPERTY_INSTANCE_CHANNELS, s );
currentBlock.getInnerBlocks().add( p );

相关文章