Example usage for com.google.common.io BaseEncoding lowerCase

List of usage examples for com.google.common.io BaseEncoding lowerCase

Introduction

In this page you can find the example usage for com.google.common.io BaseEncoding lowerCase.

Prototype

@CheckReturnValue
public abstract BaseEncoding lowerCase();

Source Link

Document

Returns an encoding that behaves equivalently to this encoding, but encodes and decodes with lowercase letters.

Usage

From source file:com.lithium.flow.util.BaseEncodings.java

@Nonnull
public static BaseEncoding of(@Nonnull String name) {
    checkNotNull(name);//w w w  .  j  a v  a2 s  .c o m

    Iterator<String> it = Splitter.on(".").split(name).iterator();
    BaseEncoding encoding = getEncoding(it.next());
    while (it.hasNext()) {
        String mod = it.next();
        switch (mod) {
        case "lowerCase":
            encoding = encoding.lowerCase();
            break;
        case "upperCase":
            encoding = encoding.upperCase();
            break;
        case "omitPadding":
            encoding = encoding.omitPadding();
            break;
        default:
            throw new RuntimeException("unknown modifier: " + mod);
        }
    }
    return encoding;
}