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

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

Introduction

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

Prototype

@CheckReturnValue
public abstract BaseEncoding upperCase();

Source Link

Document

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

Usage

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

@Nonnull
public static BaseEncoding of(@Nonnull String name) {
    checkNotNull(name);//  ww  w  .  j  ava 2 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;
}