joptsimple.internal.Strings类的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(295)

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

Strings介绍

暂无

代码示例

代码示例来源:origin: runelite/runelite

public void loadStopwatches()
{
  final String stopwatchesJson = configManager.getConfiguration(TimeTrackingConfig.CONFIG_GROUP, TimeTrackingConfig.STOPWATCHES);
  if (!Strings.isNullOrEmpty(stopwatchesJson))
  {
    final Gson gson = new Gson();
    final List<Stopwatch> stopwatches = gson.fromJson(stopwatchesJson, new TypeToken<ArrayList<Stopwatch>>()
    {
    }.getType());
    this.stopwatches.clear();
    this.stopwatches.addAll(stopwatches);
    SwingUtilities.invokeLater(clockTabPanel::rebuild);
  }
}

代码示例来源:origin: apache/geode

} else {
 File file = new File(xmlFile).getAbsoluteFile();
 FileUtils.write(file, Strings.join(xmlSection.getContent(), System.lineSeparator()),
   Charset.defaultCharset());
 xmlSection.removeLine(0);

代码示例来源:origin: io.snappydata/gemfire-joptsimple

void writeSeparatorOn( StringBuilder buffer, boolean appendSpace ) {
  buffer.append( repeat( '-', header.length() ) ).append( repeat( ' ', width - header.length() ) );
  if ( appendSpace )
    buffer.append( ' ' );
}

代码示例来源:origin: io.snappydata/gemfire-util

private void addHelpLineWithArgument( OptionDescriptor descriptor, char begin, char end ) {
  String argDescription = descriptor.argumentDescription();
  String typeIndicator = typeIndicator( descriptor );
  StringBuilder collector = new StringBuilder();
  if ( typeIndicator.length() > 0 ) {
    collector.append( typeIndicator );
    if ( argDescription.length() > 0 )
      collector.append( ": " ).append( argDescription );
  }
  else if ( argDescription.length() > 0 )
    collector.append( argDescription );
  String helpLine = collector.length() == 0
    ? ""
    : ' ' + surround( collector.toString(), begin, end );
  addHelpLineFor( descriptor, helpLine );
}

代码示例来源:origin: io.snappydata/gemfire-util

void writeSeparatorOn( StringBuilder buffer, boolean appendSpace ) {
  buffer.append( repeat( '-', header.length() ) ).append( repeat( ' ', width - header.length() ) );
  if ( appendSpace )
    buffer.append( ' ' );
}

代码示例来源:origin: org.apache.geode/geode-joptsimple

private void addHelpLineWithArgument( OptionDescriptor descriptor, char begin, char end ) {
  String argDescription = descriptor.argumentDescription();
  String typeIndicator = typeIndicator( descriptor );
  StringBuilder collector = new StringBuilder();
  if ( typeIndicator.length() > 0 ) {
    collector.append( typeIndicator );
    if ( argDescription.length() > 0 )
      collector.append( ": " ).append( argDescription );
  }
  else if ( argDescription.length() > 0 )
    collector.append( argDescription );
  String helpLine = collector.length() == 0
    ? ""
    : ' ' + surround( collector.toString(), begin, end );
  addHelpLineFor( descriptor, helpLine );
}

代码示例来源:origin: runelite/runelite

public void loadTimers()
{
  final String timersJson = configManager.getConfiguration(TimeTrackingConfig.CONFIG_GROUP, TimeTrackingConfig.TIMERS);
  if (!Strings.isNullOrEmpty(timersJson))
  {
    final Gson gson = new Gson();
    final List<Timer> timers = gson.fromJson(timersJson, new TypeToken<ArrayList<Timer>>()
    {
    }.getType());
    this.timers.clear();
    this.timers.addAll(timers);
    SwingUtilities.invokeLater(clockTabPanel::rebuild);
  }
}

代码示例来源:origin: apache/geode

+ configuration.getGemfireProperties().size());
logger.info(configuration.getConfigName() + " jars: "
  + Strings.join(configuration.getJarNames(), ", "));
sharedConfiguration.put(groupName.getName(), configuration);
if (needToCopyJars && configuration.getJarNames().size() > 0) {

代码示例来源:origin: net.sf.jopt-simple/jopt-simple

private StringBuilder pad( StringBuilder buffer, String s, int length ) {
    buffer.append( s ).append( repeat( ' ', length - s.length() ) );
    return buffer;
  }
}

代码示例来源:origin: io.snappydata/gemfire-joptsimple

private void addHelpLineWithArgument( OptionDescriptor descriptor, char begin, char end ) {
  String argDescription = descriptor.argumentDescription();
  String typeIndicator = typeIndicator( descriptor );
  StringBuilder collector = new StringBuilder();
  if ( typeIndicator.length() > 0 ) {
    collector.append( typeIndicator );
    if ( argDescription.length() > 0 )
      collector.append( ": " ).append( argDescription );
  }
  else if ( argDescription.length() > 0 )
    collector.append( argDescription );
  String helpLine = collector.length() == 0
    ? ""
    : ' ' + surround( collector.toString(), begin, end );
  addHelpLineFor( descriptor, helpLine );
}

代码示例来源:origin: apache/incubator-gobblin

public BaseDataNode(Config nodeProps) throws DataNodeCreationException {
 try {
  String nodeId = ConfigUtils.getString(nodeProps, FlowGraphConfigurationKeys.DATA_NODE_ID_KEY, "");
  Preconditions.checkArgument(!Strings.isNullOrEmpty(nodeId), "Node Id cannot be null or empty");
  this.id = nodeId;
  if (nodeProps.hasPath(FlowGraphConfigurationKeys.DATA_NODE_IS_ACTIVE_KEY)) {
   this.active = nodeProps.getBoolean(FlowGraphConfigurationKeys.DATA_NODE_IS_ACTIVE_KEY);
  }
  this.rawConfig = nodeProps;
 } catch (Exception e) {
  throw new DataNodeCreationException(e);
 }
}

代码示例来源:origin: apache/geode

InfoResultModel jarSection = result.addInfo("jars");
jarSection.setHeader("Jars: ");
jarSection.addLine(Strings.join(jarNames, ", "));

代码示例来源:origin: jopt-simple/jopt-simple

private StringBuilder pad( StringBuilder buffer, String s, int length ) {
    buffer.append( s ).append( repeat( ' ', length - s.length() ) );
    return buffer;
  }
}

代码示例来源:origin: io.snappydata/gemfire-util

private String createDescriptionDisplay( OptionDescriptor descriptor ) {
  List<?> defaultValues = descriptor.defaultValues();
  if ( defaultValues.isEmpty() )
    return descriptor.description();
  String defaultValuesDisplay = createDefaultValuesDisplay( defaultValues );
  return descriptor.description() + ' ' + surround( "default: " + defaultValuesDisplay, '(', ')' );
}

代码示例来源:origin: apache/geode

private Object newInstance(String className)
  throws ClassNotFoundException, IllegalAccessException, InstantiationException {
 if (Strings.isNullOrEmpty(className)) {
  return null;
 }
 return ClassPathLoader.getLatest().forName(className).newInstance();
}

代码示例来源:origin: net.sf.jopt-simple/jopt-simple

/**
 * Gives a string consisting of the elements of a given array of strings, each separated by a given separator
 * string.
 *
 * @param pieces the strings to join
 * @param separator the separator
 * @return the joined string
 */
public static String join( String[] pieces, String separator ) {
  return join( asList( pieces ), separator );
}

代码示例来源:origin: org.apache.geode/geode-joptsimple

void writeSeparatorOn( StringBuilder buffer, boolean appendSpace ) {
  buffer.append( repeat( '-', header.length() ) ).append( repeat( ' ', width - header.length() ) );
  if ( appendSpace )
    buffer.append( ' ' );
}

代码示例来源:origin: io.snappydata/gemfire-joptsimple

private String createDescriptionDisplay( OptionDescriptor descriptor ) {
  List<?> defaultValues = descriptor.defaultValues();
  if ( defaultValues.isEmpty() )
    return descriptor.description();
  String defaultValuesDisplay = createDefaultValuesDisplay( defaultValues );
  return descriptor.description() + ' ' + surround( "default: " + defaultValuesDisplay, '(', ')' );
}

代码示例来源:origin: apache/geode

private Object newInstance(String className)
  throws ClassNotFoundException, IllegalAccessException, InstantiationException {
 if (Strings.isNullOrEmpty(className)) {
  return null;
 }
 return ClassPathLoader.getLatest().forName(className).newInstance();
}

代码示例来源:origin: io.snappydata/gemfire-joptsimple

/**
 * Gives a string consisting of the elements of a given array of strings, each separated by a given separator
 * string.
 *
 * @param pieces the strings to join
 * @param separator the separator
 * @return the joined string
 */
public static String join( String[] pieces, String separator ) {
  return join( asList( pieces ), separator );
}

相关文章

微信公众号

最新文章

更多