Example usage for org.apache.commons.lang WordUtils capitalizeFully

List of usage examples for org.apache.commons.lang WordUtils capitalizeFully

Introduction

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

Prototype

public static String capitalizeFully(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:example.HelloIvy.java

public static void main(String[] args) throws Exception {
    String message = "Hello Ivy!";
    System.out.println("standard message : " + message);
    System.out.println(// w w  w  .j a  v a  2s  . c  o m
            "capitalized by " + WordUtils.class.getName() + " : " + WordUtils.capitalizeFully(message));

    HttpClient client = new HttpClient();
    HeadMethod head = new HeadMethod("http://www.ibiblio.org/");
    client.executeMethod(head);

    int status = head.getStatusCode();
    System.out.println("head status code with httpclient: " + status);
    head.releaseConnection();

    System.out.println("now check if httpclient dependency on commons-logging has been realized");
    Class<?> clss = Class.forName("org.apache.commons.logging.Log");
    System.out.println("found logging class in classpath: " + clss);
}

From source file:example.HelloConsole.java

public static void main(String[] args) throws Exception {
    Option msg = Option.builder("m").longOpt("message").hasArg().desc("the message to capitalize").build();
    Options options = new Options();
    options.addOption(msg);//from  w w  w  . j  ava 2  s  . c  o  m

    CommandLineParser parser = new DefaultParser();
    CommandLine line = parser.parse(options, args);

    String message = line.getOptionValue("m", "Hello Ivy!");
    System.out.println("standard message : " + message);
    System.out.println(
            "capitalized by " + WordUtils.class.getName() + " : " + WordUtils.capitalizeFully(message));
}

From source file:ant_ivy.Hello.java

public static void main(String[] args) throws Exception {
    Option msg = OptionBuilder.withArgName("msg").hasArg().withDescription("the message to capitalize")
            .create("message");
    Options options = new Options();
    options.addOption(msg);/* ww  w  .  j a v  a 2 s .  co  m*/

    CommandLineParser parser = new GnuParser();
    CommandLine line = parser.parse(options, args);

    String message = line.getOptionValue("message", "hello ivy !");
    System.out.println("standard message : " + message);
    System.out.println(
            "capitalized by " + WordUtils.class.getName() + " : " + WordUtils.capitalizeFully(message));
}

From source file:com.talkingdata.orm.tool.ClassUtils.java

public static String capitalizeFully(String name) {
    name = name.replace("-", " ").replace("_", " ");
    return WordUtils.capitalizeFully(name).replace(" ", "");
}

From source file:com.turqmelon.MelonDamageLib.utils.EntityUtil.java

public static String getEntityName(Entity entity) {
    if (entity.getCustomName() != null) {
        return entity.getCustomName();
    } else {//from  w  w w  . j a  v a  2 s.  com
        String name = entity.getType().name();
        name = name.replace("_", " ");
        return WordUtils.capitalizeFully(name);
    }
}

From source file:com.noxpvp.noxguilds.util.NoxEnumUtil.java

public static String getFriendlyName(Enum<?> e) {
    return WordUtils.capitalizeFully(e.name().replace("_", " ").toLowerCase());
}

From source file:com.mirth.connect.model.alert.AlertActionProtocol.java

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

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

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

From source file:com.ro.ssc.app.client.utils.AccessReader.java

public static List<Set<String>> updateUserMap(File file) {

    Set<String> excludedGates = new LinkedHashSet<>();
    Set<String> excludedUsers = new LinkedHashSet<>();
    Set<String> idMapping = new LinkedHashSet<>();
    List<Set<String>> result = new LinkedList<>();

    Table table;// ww w.  ja  v a  2  s.c om
    try {

        table = DatabaseBuilder.open(file).getTable("t_b_Reader");
        Cursor cursor = CursorBuilder.createCursor(table);
        for (Row row : cursor.newIterable().addMatchPattern("f_Attend", 0)) {

            excludedGates.add(String.format("%s", row.get("f_ReaderName")));
        }
        table = DatabaseBuilder.open(file).getTable("t_b_Consumer");
        cursor = CursorBuilder.createCursor(table);
        for (Row row : cursor.newIterable()) {
            idMapping.add(String.format("%s", row.get("f_ConsumerID")).trim() + "-"
                    + WordUtils.capitalizeFully(String.format("%s", row.get("f_ConsumerName")).trim()));

            if (!String.format("%s", row.get("f_AttendEnabled")).contains("1")) {
                excludedUsers.add(WordUtils.capitalizeFully(String.format("%s", row.get("f_ConsumerName"))));
            }
        }

    } catch (IOException ex) {
        log.error("Exceptie", ex);
    }

    result.add(idMapping);
    result.add(excludedGates);
    result.add(excludedUsers);

    return result;
}

From source file:net.lordsofcode.zephyrus.effects.EffectType.java

EffectType(IEffect effect, int id, String name) {
    this.effect = effect;
    this.id = id;
    this.name = name.toLowerCase();
    Lang.add("effects." + name.toLowerCase() + ".name", WordUtils.capitalizeFully(name));
    if (effect instanceof Listener) {
        Bukkit.getServer().getPluginManager().registerEvents((Listener) effect, Zephyrus.getPlugin());
    }//from w  ww.j  a  va 2 s  .  co m
}