Example usage for com.google.common.base CaseFormat LOWER_HYPHEN

List of usage examples for com.google.common.base CaseFormat LOWER_HYPHEN

Introduction

In this page you can find the example usage for com.google.common.base CaseFormat LOWER_HYPHEN.

Prototype

CaseFormat LOWER_HYPHEN

To view the source code for com.google.common.base CaseFormat LOWER_HYPHEN.

Click Source Link

Document

Hyphenated variable naming convention, e.g., "lower-hyphen".

Usage

From source file:org.apache.brooklyn.util.core.task.BasicExecutionManager.java

/** invoked in a task's thread when a task is starting to run (may be some time after submitted), 
 * but before doing any of the task's work, so that we can update bookkeeping and notify callbacks */
protected void internalBeforeStart(Map<?, ?> flags, Task<?> task) {
    activeTaskCount.incrementAndGet();//from   w  ww.ja va 2  s  .  c om

    //set thread _before_ start time, so we won't get a null thread when there is a start-time
    if (log.isTraceEnabled())
        log.trace("" + this + " beforeStart, task: " + task);
    if (!task.isCancelled()) {
        Thread thread = Thread.currentThread();
        ((TaskInternal<?>) task).setThread(thread);
        if (RENAME_THREADS) {
            threadOriginalName.set(thread.getName());
            String newThreadName = "brooklyn-"
                    + CaseFormat.LOWER_HYPHEN.to(CaseFormat.LOWER_CAMEL, task.getDisplayName().replace(" ", ""))
                    + "-" + task.getId().substring(0, 8);
            thread.setName(newThreadName);
        }
        PerThreadCurrentTaskHolder.perThreadCurrentTask.set(task);
        ((TaskInternal<?>) task).setStartTimeUtc(System.currentTimeMillis());
    }
    invokeCallback(flags.get("newTaskStartCallback"), task);
}

From source file:com.google.javascript.jscomp.PolymerPass.java

/**
 * @return The PolymerElement type string for a class definition.
 *//*from w ww. j av  a 2 s.  c  o  m*/
private static String getPolymerElementType(final ClassDefinition cls) {
    return SimpleFormat.format("Polymer%sElement", cls.nativeBaseElement == null ? ""
            : CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_CAMEL, cls.nativeBaseElement));
}