Example usage for org.apache.commons.lang3.text WordUtils capitalizeFully

List of usage examples for org.apache.commons.lang3.text WordUtils capitalizeFully

Introduction

In this page you can find the example usage for org.apache.commons.lang3.text WordUtils capitalizeFully.

Prototype

public static String capitalizeFully(final String str) 

Source Link

Document

Converts all the whitespace separated words in a String into capitalized words, that is each word is made up of a titlecase character and then a series of lowercase characters.

Usage

From source file:mod.steamnsteel.item.SteamNSteelItem.java

public static String getFormattedName(Material material) {
    return WordUtils.capitalizeFully(material.name().toLowerCase());
}

From source file:com.threewks.thundr.bigmetrics.bigquery.BigQueryType.java

public static BigQueryType from(String value) {
    return BigQueryType.valueOf(WordUtils.capitalizeFully(value));
}

From source file:com.threewks.thundr.view.jsp.el.StringFunctions.java

public static String capitalise(Object arg) {
    return arg == null ? null : WordUtils.capitalizeFully(arg.toString());
}

From source file:com.mirth.connect.donkey.model.channel.DeployedState.java

@Override
public String toString() {
    return WordUtils.capitalizeFully(super.toString());
}

From source file:me.ardacraft.blocksapi.helper.LangHelper.java

private static String getNeatName(String s) {
    String name = s.substring(5).replace(".name", "").replace("_", " ");
    if (name.endsWith(" Block")) {
        return name.replace(" Block", "");
    }//from ww  w  . j  a  v  a 2  s .c om
    return WordUtils.capitalizeFully(name);
}

From source file:com.pgcraft.spectatorplus.utils.SPUtils.java

/**
 * Returns the user-friendly name of the given effect.
 *
 * <p>As example, "SLOW_DIGGING" becomes "Mining Fatigue".</p>
 *
 * @param type The potion effect type./*w  ww.  j  ava 2s. c o m*/
 * @return An user-friendly name.
 */
public static String getEffectName(PotionEffectType type) {
    if (type.equals(PotionEffectType.CONFUSION))
        return "Nausea";

    else if (type.equals(PotionEffectType.FAST_DIGGING))
        return "Haste";

    else if (type.equals(PotionEffectType.SLOW_DIGGING))
        return "Mining Fatigue";

    else if (type.equals(PotionEffectType.INCREASE_DAMAGE))
        return "Strength";

    else if (type.equals(PotionEffectType.HEAL))
        return "Instant Health";

    else if (type.equals(PotionEffectType.INCREASE_DAMAGE))
        return "Instant Damage";

    else if (type.equals(PotionEffectType.JUMP))
        return "Jump Boost";

    else
        return WordUtils.capitalizeFully(type.getName().replace("_", " "));
}

From source file:com.mirth.connect.donkey.model.event.ConnectionStatusEventType.java

@Override
public String toString() {
    return WordUtils.capitalizeFully(super.toString().replace("_", " "));
}

From source file:com.fdorigo.rmfly.jpa.session.RecordFacade.java

public Record buildFromMaster(String id) {
    Record newRecord = em.find(Record.class, id);
    if (newRecord == null) {
        newRecord = new Record(id);

        final Master faaMasterRecord = em.find(Master.class, id);
        if (faaMasterRecord != null) {
            newRecord.setLastName(WordUtils.capitalizeFully(StringUtils.trim(faaMasterRecord.getName())));
            newRecord.setAddressCity(WordUtils.capitalizeFully(StringUtils.trim(faaMasterRecord.getCity())));
            newRecord.setAddressOne(WordUtils.capitalizeFully(StringUtils.trim(faaMasterRecord.getStreet())));
            newRecord.setAddressTwo(WordUtils.capitalizeFully(StringUtils.trim(faaMasterRecord.getStreet2())));
            newRecord.setAddressState(WordUtils.capitalizeFully(StringUtils.trim(faaMasterRecord.getState())));
            newRecord.setAddressZip(StringUtils.trim(faaMasterRecord.getZip()));

            final Acftref faaAircraftRecord = em.find(Acftref.class, faaMasterRecord.getMfrmdlcode());
            if (faaAircraftRecord != null) {
                newRecord.setAirplaneModel(WordUtils.capitalizeFully(faaAircraftRecord.getModel()));
                newRecord.setAirplaneMake(WordUtils.capitalizeFully(faaAircraftRecord.getMfrname()));
            }//  w w w .  ja va2s .co m
        }
    }

    return newRecord;
}

From source file:info.novatec.testit.livingdoc.util.NameUtils.java

/**
 * Tries to convert <code>string</code> to a Java class name by following a
 * few simple steps:// ww  w  .j  a  v  a 2 s. co m
 * <p>
 * <p>
 * <ul>
 * <li>First of all, <code>string</code> gets <i>camel cased</i>, the usual
 * Java class naming convention.
 * <li>Secondly, any whitespace, by virtue of
 * <code>Character.isWhitespace()</code> is removed from the camel cased
 * <code>string</code>.
 * <li>Third, all accented characters (diacritis) are replaced by their
 * non-accented equivalent (ex: \u00e9 -&gt; e)</li>
 * <li>Fourth, all non java identifier characters are removed</li>
 * </ul>
 * <p>
 * The only exception to executing these two steps is when
 * <code>string</code> represents a fully-qualified class name. To check if
 * <code>string</code> represents a fully-qualified class name, a simple
 * validation of the existence of the '.' character is made on
 * <code>string</code>.
 * 
 * @param s The String that may represent a Java class name
 * @return The input string converted by following the documented steps
 */
public static String toClassName(String s) {
    if (StringUtils.isEmpty(s) || s.contains(".")) {
        return s;
    }
    return removeNonJavaIdentifierCharacters(
            StringUtils.stripAccents(StringUtils.deleteWhitespace(WordUtils.capitalizeFully(s))));
}

From source file:com.splicemachine.derby.utils.SpliceStringFunctions.java

/**
 * Implements logic for the SQL function INITCAP.
 * /*from   w ww. j a v a2s  . co  m*/
 * @param source the String to be capitalized
 * 
 * @return the capitalized String
 */
public static String INITCAP(String source) {
    return WordUtils.capitalizeFully(source);
}