本文整理匯總了Java中com.google.common.base.Ascii.toUpperCase方法的典型用法代碼示例。如果您正苦於以下問題:Java Ascii.toUpperCase方法的具體用法?Java Ascii.toUpperCase怎麽用?Java Ascii.toUpperCase使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.common.base.Ascii
的用法示例。
在下文中一共展示了Ascii.toUpperCase方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: upperCase
import com.google.common.base.Ascii; //導入方法依賴的package包/類
Alphabet upperCase() {
if (!hasLowerCase()) {
return this;
} else {
checkState(!hasUpperCase(), "Cannot call upperCase() on a mixed-case alphabet");
char[] upperCased = new char[chars.length];
for (int i = 0; i < chars.length; i++) {
upperCased[i] = Ascii.toUpperCase(chars[i]);
}
return new Alphabet(name + ".upperCase()", upperCased);
}
}
示例2: setMethod
import com.google.common.base.Ascii; //導入方法依賴的package包/類
public final T setMethod(CharSequence method) {
this.method = Ascii.toUpperCase(method);
if (!isPayloadAllowed()) {
setContentLength(0);
}
return castThis();
}
示例3: newAddressTransform
import com.google.common.base.Ascii; //導入方法依賴的package包/類
private static Function<Map<String, ?>, RegistrarAddress> newAddressTransform(
final FormField<List<String>, List<String>> streetField,
final FormField<String, String> cityField,
final FormField<String, String> stateField,
final FormField<String, String> zipField) {
return args -> {
if (args == null) {
return null;
}
RegistrarAddress.Builder builder = new RegistrarAddress.Builder();
String countryCode = COUNTRY_CODE_FIELD.extractUntyped(args).get();
builder.setCountryCode(countryCode);
streetField
.extractUntyped(args)
.ifPresent(streets -> builder.setStreet(ImmutableList.copyOf(streets)));
cityField.extractUntyped(args).ifPresent(builder::setCity);
Optional<String> stateFieldValue = stateField.extractUntyped(args);
if (stateFieldValue.isPresent()) {
String state = stateFieldValue.get();
if ("US".equals(countryCode)) {
state = Ascii.toUpperCase(state);
if (!StateCode.US_MAP.containsKey(state)) {
throw new FormFieldException(stateField, "Unknown US state code.");
}
}
builder.setState(state);
}
zipField.extractUntyped(args).ifPresent(builder::setZip);
return builder.build();
};
}
示例4: toLowerCase
import com.google.common.base.Ascii; //導入方法依賴的package包/類
public static char toLowerCase(char c) {
return Ascii.toUpperCase(c);
}
示例5: toUpperCase
import com.google.common.base.Ascii; //導入方法依賴的package包/類
public static String toUpperCase(String string) {
if (string != null) {
return Ascii.toUpperCase(string);
}
return null;
}
示例6: setVersion
import com.google.common.base.Ascii; //導入方法依賴的package包/類
public final T setVersion(CharSequence version) {
this.version = Ascii.toUpperCase(version);
return castThis();
}