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

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

Introduction

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

Prototype

public boolean equals(Object obj) 

Source Link

Document

Indicates whether some other object is "equal to" this one.

Usage

From source file:com.google.api.codegen.util.Name.java

private String toCamel(CaseFormat caseFormat) {
    StringBuffer buffer = new StringBuffer();
    boolean firstPiece = true;
    for (NamePiece namePiece : namePieces) {
        if (firstPiece && caseFormat.equals(CaseFormat.LOWER_CAMEL)) {
            buffer.append(namePiece.caseFormat.to(CaseFormat.LOWER_CAMEL, namePiece.identifier));
        } else {/* www. jav a 2  s .co m*/
            CaseFormat toCaseFormat = CaseFormat.UPPER_CAMEL;
            if (namePiece.casingMode.equals(CasingMode.UPPER_CAMEL_TO_SQUASHED_UPPERCASE)) {
                toCaseFormat = CaseFormat.UPPER_UNDERSCORE;
            }
            buffer.append(namePiece.caseFormat.to(toCaseFormat, namePiece.identifier));
        }
        firstPiece = false;
    }
    return buffer.toString();
}