/** * 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 ()); }
@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); }
@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); }
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); } }
final String sCombinedSchemes = StringHelper.getImplodedNonEmpty (',', aAllowedExternalSchemes); if (sCombinedSchemes.length () > 0)
@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 ()); } }
@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 ()); } }