/** * <p> * Returns either the passed in <code>Object</code> as a String, or, if the <code>Object</code> is * <code>null</code>, an empty String. * </p> * * @param obj the Object to check * @return the passed in Object's toString, or blank if it was <code>null</code> */ public static String defaultString( Object obj ) { return defaultString( obj, "" ); }
buffer.append( StringUtils.defaultString( premanagedScope, "default" ) ); buffer.append( ')' ); buffer.append( StringUtils.defaultString( premanagedVersion, "default" ) ); buffer.append( ')' ); buffer.append( StringUtils.defaultString( premanagedOptional, "default" ) ); buffer.append( ')' );
+ StringUtils.defaultString( dependency.getVersion(), "(?)" ); msg = "version " + StringUtils.defaultString( existing.getVersion(), "(?)" ) + " vs " + StringUtils.defaultString( dependency.getVersion(), "(?)" );
public String getName() { return StringUtils.defaultString(myName); }
public String getDescription() { return StringUtils.defaultString(myDescription); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ValueSetTm other = (ValueSetTm) obj; String id1 = myId != null && myId.isEmpty() == false ? myId : myName; String id2 = other.myId != null && other.myId.isEmpty() == false ? other.myId : other.myName; id1 = StringUtils.defaultString(id1); id2 = StringUtils.defaultString(id2); return id1.equals(id2); }
public Dpkg setDpkgDebPath( String dpkgDebPath ) { this.dpkgDebPath = StringUtils.defaultString( dpkgDebPath, this.dpkgDebPath ); return this; }
@Override public String toString() { if (this.classifier == null) { return groupId + ":" + artifactId + ":" + StringUtils.defaultString(version, "?") + ":" + type; } else { return groupId + ":" + artifactId + ":" + classifier + ":" + StringUtils.defaultString(version, "?") + ":" + type; } }
public Rpmbuild setRpmbuildPath( String rpmbuildPath ) { this.rpmbuildPath = StringUtils.defaultString( rpmbuildPath, this.rpmbuildPath ); return this; }
@Override public String toString() { if (this.classifier == null) { return groupId + ":" + artifactId + ":" + StringUtils.defaultString(version, "?") + ":" + type; } else { return groupId + ":" + artifactId + ":" + classifier + ":" + StringUtils.defaultString(version, "?") + ":" + type; } }
/** * <p>Returns either the passed in <code>Object</code> as a String, * or, if the <code>Object</code> is <code>null</code>, an empty * String.</p> * * @param obj the Object to check * @return the passed in Object's toString, or blank if it was * <code>null</code> */ public static String defaultString( Object obj ) { return defaultString( obj, "" ); }
@Override public String toString() { if ( this.classifier == null ) { return groupId + ":" + artifactId + ":" + StringUtils.defaultString( version, "?" ) + ":" + type; } else { return groupId + ":" + artifactId + ":" + classifier + ":" + StringUtils.defaultString( version, "?" ) + ":" + type; } }
/** * Returns a string array of the includes to be used * when adding dependent wars as an overlay onto this war. * * @return an array of tokens to include */ protected String[] getDependentWarIncludes() { return StringUtils.split(StringUtils.defaultString(dependentWarIncludes), ","); }
/** * Returns a string array of the includes to be used * when assembling/copying the war. * * @return an array of tokens to include */ protected String[] getIncludes() { return StringUtils.split(StringUtils.defaultString(warSourceIncludes), ","); }
private void configureMetadata(SenchaPackageOrAppConfigBuilder configBuilder) { String version = SenchaUtils.getSenchaVersionForMavenVersion(project.getVersion()); if (version == null) { version = SENCHA_FALLBACK_VERSION; getLog().warn("Could not determine Sencha version from maven version " + project.getVersion() + ", falling back to " + version + "."); } configBuilder.name(getSenchaPackageName(project.getGroupId(), project.getArtifactId())); configBuilder.version(version); configBuilder.creator(StringUtils.defaultString(project.getOrganization() != null ? project.getOrganization().getName() : "")); configBuilder.summary(StringUtils.defaultString(project.getDescription())); }
/** * Compare groupId && artifactId && type && classifier. * * @param overlay the overlay * @param artifact the artifact * @return boolean true if equals */ private boolean compareOverlayWithArtifact( Overlay overlay, Artifact artifact ) { return ( StringUtils.equals( overlay.getGroupId(), artifact.getGroupId() ) && StringUtils.equals( overlay.getArtifactId(), artifact.getArtifactId() ) && StringUtils.equals( overlay.getType(), artifact.getType() ) // MWAR-241 Make sure to treat null and "" as equal when comparing the classifier && StringUtils.equals( StringUtils.defaultString( overlay.getClassifier() ), StringUtils.defaultString( artifact.getClassifier() ) ) ); }
public void checkResult( ScmResult result ) throws MojoExecutionException { if ( !result.isSuccess() ) { getLog().error( "Provider message:" ); getLog().error( result.getProviderMessage() == null ? "" : result.getProviderMessage() ); getLog().error( "Command output:" ); getLog().error( result.getCommandOutput() == null ? "" : result.getCommandOutput() ); throw new MojoExecutionException( "Command failed." + StringUtils.defaultString( result.getProviderMessage() ) ); } }
private void checkResult( ScmResult result ) throws MojoExecutionException { if ( !result.isSuccess() ) { getLog().debug( "Provider message:" ); getLog().debug( result.getProviderMessage() == null ? "" : result.getProviderMessage() ); getLog().debug( "Command output:" ); getLog().debug( result.getCommandOutput() == null ? "" : result.getCommandOutput() ); throw new MojoExecutionException( "Command failed." + StringUtils.defaultString( result.getProviderMessage() ) ); } }
@Override public void removeUser(String username, LdapContext context, LdapAuthConfiguration configuration) throws NoSuchLdapUserException, LdapDAOException { log.info("Remove user: " + username); try { context = (LdapContext) context.lookup(StringUtils.defaultString(configuration.getUserBaseDn(), "")); context.destroySubcontext(configuration.getUserIdAttribute() + "=" + username); } catch (NamingException e) { String message = "Failed to remove user: " + username; throw new LdapDAOException(message, e); } }
public void removeUser( String username, LdapContext context, LdapAuthConfiguration configuration ) throws NoSuchLdapUserException, LdapDAOException { getLogger().info( "Searching for user: " + username ); try { context = (LdapContext) context.lookup( StringUtils.defaultString( configuration.getUserBaseDn(), "" ) ); context.destroySubcontext( configuration.getUserIdAttribute() + "=" + username ); } catch ( NamingException e ) { String message = "Failed to remove user: " + username; throw new LdapDAOException( message, e ); } }