Example usage for org.apache.commons.lang StringUtils capitalize

List of usage examples for org.apache.commons.lang StringUtils capitalize

Introduction

In this page you can find the example usage for org.apache.commons.lang StringUtils capitalize.

Prototype

public static String capitalize(String str) 

Source Link

Document

Capitalizes a String changing the first letter to title case as per Character#toTitleCase(char) .

Usage

From source file:com.migratebird.script.analyzer.ScriptUpdatesFormatter.java

/**
 * @param scriptUpdates The script updates, not null
 * @return An printable overview of the regular script updates
 *///from w  w  w . j  a  v  a  2s .c  o m
public String formatScriptUpdates(SortedSet<ScriptUpdate> scriptUpdates) {
    StringBuilder formattedUpdates = new StringBuilder();
    int index = 0;
    for (ScriptUpdate scriptUpdate : scriptUpdates) {
        formattedUpdates.append("  ").append(++index).append(". ")
                .append(StringUtils.capitalize(formatScriptUpdate(scriptUpdate))).append("\n");
    }
    return formattedUpdates.toString();
}

From source file:com.netflix.spinnaker.halyard.cli.command.v1.config.security.ui.AbstractEnableDisableSslCommand.java

@Override
public String getShortDescription() {
    return StringUtils.capitalize(getCommandName()) + " SSL for the UI gateway.";
}

From source file:com.netflix.spinnaker.halyard.cli.command.v1.config.security.api.AbstractEnableDisableSslCommand.java

@Override
public String getShortDescription() {
    return StringUtils.capitalize(getCommandName()) + " SSL for the API gateway.";
}

From source file:com.bluexml.side.clazz.alfresco.reverse.reverser.Reverser.java

public static void executeReverse(Collection<File> alfrescoModels, File sideModelRepo, List<IFile> sideModels,
        boolean verbose) throws Exception {
    ReverseScheduler rs = new ReverseScheduler(alfrescoModels, verbose);
    rs.schedule();/* w  w  w .j  a  v  a2  s.  com*/
    Map<Integer, List<Model>> tree = rs.getTree();
    // reverse according to scheduled order (import dependencies tree)
    ReverseModel rm = new ReverseModel(verbose);
    // load and register EObject from existing SIDE models
    rm.loadSIDEModels(sideModels);
    // execute reverse
    for (Map.Entry<Integer, List<Model>> ent : tree.entrySet()) {
        for (Model model : ent.getValue()) {
            EObject sideO = rm.reverse(model);
            String name = model.getName();
            String modelName = ReverseHelper.extractLocalNameFromAlfQName(name);
            String modelPrefix = ReverseHelper.extractPrefixFromAlfQName(name);

            File file = new File(sideModelRepo, modelPrefix + StringUtils.capitalize(modelName) + ".dt");
            file.getParentFile().mkdirs();
            file.createNewFile();
            System.out.println("save model :" + file);
            EResourceUtils.saveModel(file, sideO);
        }
    }

    List<Object> notReverted = rm.getNotReverted();

    if (notReverted.size() > 0) {
        List<String> errorRepport = new ArrayList<String>();
        for (Object object : notReverted) {
            Class c = (Class) object;
            errorRepport.add(c.getName());
        }

        System.err.println("Fail to reverse Overrides for :" + errorRepport);
    }
}

From source file:com.example.SessionLogout.java

public void six() {
    Session session = null; // Noncompliant
    String plotTwist = "twist";
    plotTwist = "anotherTwist";
    plotTwist = getMeAnotherTwist();//from  w ww . ja  v  a  2 s  .  c om
    plotTwist = StringUtils.capitalize(plotTwist);
    try {
        session = repository.loginService(null, null);
    } catch (RepositoryException e) {
        e.printStackTrace();
    } finally {
        if (session != null && session.isLive()) {
            //   session.logout();
            plotTwist.toString();
        }
    }
}

From source file:com.gst.portfolio.savings.exception.DepositAccountNotFoundException.java

public DepositAccountNotFoundException(final DepositAccountType accountType, final Long id) {
    super("error.msg." + accountType.getCode().toLowerCase() + ".id.invalid",
            StringUtils.capitalize(accountType.toString().toLowerCase()) + " account with identifier " + id
                    + " does not exist",
            id);/*from w  w  w .j  av  a 2  s .  c  o  m*/
}

From source file:com.thoughtworks.go.util.ArrayUtil.java

public static <T> Object[] capitalizeContents(T[] array) {
    ArrayList<String> list = new ArrayList<String>();
    for (T t : array) {
        list.add(StringUtils.capitalize(t.toString()));
    }/*from w w w .  jav  a2 s .  c  o m*/
    return list.toArray();
}

From source file:au.org.emii.geoserver.extensions.filters.layer.data.Filter.java

public String getLabel() {
    if (label != null) {
        return label;
    }/*from w w  w  .  j av a 2s  .  c  o  m*/

    return getName() != null ? StringUtils.capitalize(getName().replaceAll("_", " ")) : null;
}

From source file:meta.paquete.base.PaqueteBase.java

@Override
public void setAlias(String alias) {
    String apodo = StringUtils.isBlank(alias) ? getClass().getSimpleName() : StringUtils.capitalize(alias);
    TipoModuloBase tipo = getTipo();//w w  w.j a  v a2 s .  com
    String prefijo = tipo == null ? null : StringUtils.capitalize(tipo.name().toLowerCase());
    String mote = tipo == null || StringUtils.startsWithIgnoreCase(apodo, prefijo) ? apodo : prefijo + apodo;
    super.setAlias(mote);
}

From source file:com.doculibre.constellio.wicket.components.locale.LocaleNameLabel.java

public LocaleNameLabel(String id, final Locale locale, final boolean addParenthesis) {
    super(id);//from w  w  w  .j  a v  a 2  s  . c o  m
    setModel(new LoadableDetachableModel() {
        @Override
        protected Object load() {
            String localeName = StringUtils.capitalize(locale.getDisplayLanguage(getLocale()));
            if (addParenthesis) {
                localeName = "(" + localeName + ")";
            }
            return localeName;
        }
    });
}