当前位置: 首页>>代码示例>>Java>>正文


Java StringHelper.getImplodedNonEmpty方法代码示例

本文整理汇总了Java中com.helger.commons.string.StringHelper.getImplodedNonEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java StringHelper.getImplodedNonEmpty方法的具体用法?Java StringHelper.getImplodedNonEmpty怎么用?Java StringHelper.getImplodedNonEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.helger.commons.string.StringHelper的用法示例。


在下文中一共展示了StringHelper.getImplodedNonEmpty方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAddressString

import com.helger.commons.string.StringHelper; //导入方法依赖的package包/类
@Nullable
public static String getAddressString (@Nullable final IPostalAddress aAddress,
                                       @Nonnull final List <EPostalAddressField> aFields,
                                       @Nonnull final Locale aDisplayLocale,
                                       @Nonnull final String sLineSeparator)
{
  ValueEnforcer.notNull (aFields, "Fields");
  ValueEnforcer.notNull (aDisplayLocale, "DisplayLocale");
  ValueEnforcer.notNull (sLineSeparator, "LineSeparator");
  if (aAddress == null)
    return null;

  final ICommonsList <String> aValues = new CommonsArrayList <> (aFields.size ());
  for (final EPostalAddressField eField : aFields)
    aValues.add (eField.get (aAddress, aDisplayLocale));
  return StringHelper.getImplodedNonEmpty (sLineSeparator, aValues);
}
 
开发者ID:phax,项目名称:ph-masterdata,代码行数:18,代码来源:PostalAddressHelper.java

示例2: internalLog

import com.helger.commons.string.StringHelper; //导入方法依赖的package包/类
@Override
protected void internalLog (@Nonnull final IError aResError)
{
  final int nLine = aResError.getErrorLocation ().getLineNumber ();
  final int nColumn = aResError.getErrorLocation ().getColumnNumber ();
  final String sMessage = StringHelper.getImplodedNonEmpty (" - ",
                                                            aResError.getErrorText (Locale.US),
                                                            aResError.getLinkedExceptionMessage ());

  // 0 means undefined line/column
  buildContext.addMessage (m_aSourceFile,
                           nLine <= 0 ? 0 : nLine,
                           nColumn <= 0 ? 0 : nColumn,
                           sMessage,
                           aResError.isError () ? BuildContext.SEVERITY_ERROR : BuildContext.SEVERITY_WARNING,
                           aResError.getLinkedExceptionCause ());
}
 
开发者ID:phax,项目名称:ph-schematron,代码行数:18,代码来源:Schematron2XSLTMojo.java

示例3: FileSystemFolderTree

import com.helger.commons.string.StringHelper; //导入方法依赖的package包/类
public FileSystemFolderTree (@Nonnull final File aStartDir,
                             @Nullable final Predicate <? super File> aDirFilter,
                             @Nullable final Predicate <? super File> aFileFilter)
{
  super (x -> StringHelper.getImplodedNonEmpty ('/', x));
  ValueEnforcer.notNull (aStartDir, "StartDirectory");
  ValueEnforcer.isTrue (aStartDir.isDirectory (), "Start directory is not a directory!");

  final DefaultFolderTreeItem <String, File, ICommonsList <File>> aStart = getRootItem ().createChildItem (aStartDir.getName (),
                                                                                                           new CommonsArrayList <> ());
  _iterate (aStart, aStartDir, aDirFilter, aFileFilter);
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:13,代码来源:FileSystemFolderTree.java

示例4: testGetStringCombinatorWithSeparatorIgnoreEmptyChar

import com.helger.commons.string.StringHelper; //导入方法依赖的package包/类
@Test
public void testGetStringCombinatorWithSeparatorIgnoreEmptyChar ()
{
  final IAggregator <String, String> c = x -> StringHelper.getImplodedNonEmpty (',', x);
  assertEquals ("a,b", c.apply ("a", "b"));
  assertEquals ("a", c.apply ("a", null));
  assertEquals ("b", c.apply (null, "b"));
  assertEquals ("", c.apply (null, null));
  assertEquals ("", c.apply ("", ""));
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:11,代码来源:IAggregatorTest.java

示例5: testGetStringCombinatorWithSeparatorIgnoreEmptyString

import com.helger.commons.string.StringHelper; //导入方法依赖的package包/类
@Test
public void testGetStringCombinatorWithSeparatorIgnoreEmptyString ()
{
  final IAggregator <String, String> c = x -> StringHelper.getImplodedNonEmpty (";", x);
  assertEquals ("a;b", c.apply ("a", "b"));
  assertEquals ("a", c.apply ("a", null));
  assertEquals ("b", c.apply (null, "b"));
  assertEquals ("", c.apply (null, null));
  assertEquals ("", c.apply ("", ""));
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:11,代码来源:IAggregatorTest.java

示例6: getStreetAndBuildingNumber

import com.helger.commons.string.StringHelper; //导入方法依赖的package包/类
@Nullable
public static String getStreetAndBuildingNumber (@Nullable final IPostalAddress aAddress)
{
  if (aAddress == null)
    return null;
  return StringHelper.getImplodedNonEmpty (' ', aAddress.getStreet (), aAddress.getBuildingNumber ());
}
 
开发者ID:phax,项目名称:ph-masterdata,代码行数:8,代码来源:PostalAddressHelper.java

示例7: getPostalCodeAndCity

import com.helger.commons.string.StringHelper; //导入方法依赖的package包/类
@Nullable
public static String getPostalCodeAndCity (@Nullable final IPostalAddress aAddress)
{
  if (aAddress == null)
    return null;
  return StringHelper.getImplodedNonEmpty (' ', aAddress.getPostalCode (), aAddress.getCity ());
}
 
开发者ID:phax,项目名称:ph-masterdata,代码行数:8,代码来源:PostalAddressHelper.java

示例8: getAsCompleteDisplayNameFirstNameFirst

import com.helger.commons.string.StringHelper; //导入方法依赖的package包/类
@Nonnull
public static String getAsCompleteDisplayNameFirstNameFirst (@Nonnull final IPersonName aName)
{
  // Concatenate all non-empty parts
  return StringHelper.getImplodedNonEmpty (' ',
                                           aName.getPrefixTitle (),
                                           aName.getFirstName (),
                                           aName.getMiddleName (),
                                           aName.getLastName (),
                                           aName.getSuffixTitle ());
}
 
开发者ID:phax,项目名称:ph-masterdata,代码行数:12,代码来源:PersonNameHelper.java

示例9: getAsCompleteDisplayNameLastNameFirst

import com.helger.commons.string.StringHelper; //导入方法依赖的package包/类
@Nonnull
public static String getAsCompleteDisplayNameLastNameFirst (@Nonnull final IPersonName aName)
{
  // Concatenate all non-empty parts
  return StringHelper.getImplodedNonEmpty (' ',
                                           aName.getPrefixTitle (),
                                           aName.getLastName (),
                                           aName.getFirstName (),
                                           aName.getMiddleName (),
                                           aName.getSuffixTitle ());
}
 
开发者ID:phax,项目名称:ph-masterdata,代码行数:12,代码来源:PersonNameHelper.java

示例10: getLogMessage

import com.helger.commons.string.StringHelper; //导入方法依赖的package包/类
@Nonnull
public static String getLogMessage (@Nullable final IReadableResource aRes,
                                    @Nullable final IPSElement aSourceElement,
                                    @Nonnull final String sMessage)
{
  return StringHelper.getImplodedNonEmpty (" - ",
                                           aRes == null ? null : aRes.getPath (),
                                           aSourceElement == null ? null
                                                                  : ClassHelper.getClassLocalName (aSourceElement),
                                           aSourceElement instanceof IPSHasID &&
                                                                                                                    ((IPSHasID) aSourceElement).hasID () ? "ID " + ((IPSHasID) aSourceElement).getID () : null,
                                           sMessage);
}
 
开发者ID:phax,项目名称:ph-schematron,代码行数:14,代码来源:LoggingPSErrorHandler.java

示例11: getAsDisplayNameFirstNameFirst

import com.helger.commons.string.StringHelper; //导入方法依赖的package包/类
@Nonnull
public static String getAsDisplayNameFirstNameFirst (@Nonnull final IPersonName aName)
{
  // Concatenate all non-empty parts
  return StringHelper.getImplodedNonEmpty (' ', aName.getFirstName (), aName.getMiddleName (), aName.getLastName ());
}
 
开发者ID:phax,项目名称:ph-masterdata,代码行数:7,代码来源:PersonNameHelper.java

示例12: getAsDisplayNameLastNameFirst

import com.helger.commons.string.StringHelper; //导入方法依赖的package包/类
@Nonnull
public static String getAsDisplayNameLastNameFirst (@Nonnull final IPersonName aName)
{
  // Concatenate all non-empty parts
  return StringHelper.getImplodedNonEmpty (' ', aName.getLastName (), aName.getFirstName (), aName.getMiddleName ());
}
 
开发者ID:phax,项目名称:ph-masterdata,代码行数:7,代码来源:PersonNameHelper.java

示例13: getDisplayNameAndCompanyType

import com.helger.commons.string.StringHelper; //导入方法依赖的package包/类
/**
 * Get display name and company type concatenated using the provided
 * separator. The separator is only used, if both fields are present and not
 * empty.
 *
 * @param sSep
 *        The separator to use. May not be <code>null</code>.
 * @return The non-<code>null</code> merged string.
 * @see #getDisplayName()
 * @see #getCompanyType()
 */
@Nonnull
default String getDisplayNameAndCompanyType (@Nonnull final String sSep)
{
  return StringHelper.getImplodedNonEmpty (sSep, getDisplayName (), getCompanyType ());
}
 
开发者ID:phax,项目名称:ph-masterdata,代码行数:17,代码来源:IAccountingArea.java


注:本文中的com.helger.commons.string.StringHelper.getImplodedNonEmpty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。