List of usage examples for com.google.common.base Ascii toLowerCase
public static char toLowerCase(char c)
From source file:org.sfs.util.NullSafeAscii.java
public static String toLowerCase(String string) { if (string != null) { return Ascii.toLowerCase(string); }/*from w w w.j ava 2 s. c o m*/ return null; }
From source file:com.facebook.buck.apple.IosTestType.java
public static IosTestType fromString(String s) { switch (Ascii.toLowerCase(s)) { case "octest": return IosTestType.OCTEST; case "xctest": return IosTestType.XCTEST; default:/*from w w w . java 2 s .c o m*/ throw new HumanReadableException("Invalid test_type value %s.", s); } }
From source file:google.registry.util.RegistrarUtils.java
/** Strip out anything that isn't a letter or digit, and lowercase. */ public static String normalizeRegistrarName(String name) { return Ascii.toLowerCase(javaLetterOrDigit().retainFrom(name)); }
From source file:com.facebook.buck.apple.AppleBundleExtension.java
public static AppleBundleExtension fromString(String s) { switch (Ascii.toLowerCase(s)) { case "app": return APP; case "framework": return FRAMEWORK; case "appex": return APPEX; case "plugin": return PLUGIN; case "bundle": return BUNDLE; case "octest": return OCTEST; case "xctest": return XCTEST; default:/*www. j a va 2s. co m*/ throw new HumanReadableException("Invalid bundle extension value %s.", s); } }
From source file:org.sfs.util.NullSafeAscii.java
public static String toLowerCase(CharSequence chars) { if (chars != null) { return Ascii.toLowerCase(chars); }// w w w .j av a2 s. co m return null; }
From source file:com.facebook.buck.apple.HeaderVisibility.java
public static HeaderVisibility fromString(String s) { switch (Ascii.toLowerCase(s)) { case "public": return HeaderVisibility.PUBLIC; case "project": return HeaderVisibility.PROJECT; case "private": return HeaderVisibility.PRIVATE; default://from w ww .j a v a 2 s. c om throw new HumanReadableException("Invalid header visibility value %s.", s); } }
From source file:com.facebook.buck.apple.AppleHeaderVisibilities.java
public static HeaderVisibility fromString(String s) { switch (Ascii.toLowerCase(s)) { case "public": return HeaderVisibility.PUBLIC; case "project": return HeaderVisibility.PRIVATE; }/* w w w. j a va2 s . c o m*/ throw new HumanReadableException("Invalid header visibility value %s.", s); }
From source file:google.registry.util.RegistrarUtils.java
/** * Returns a normalized registrar clientId by taking the input and making it lowercase and * removing all characters that aren't alphanumeric or hyphens. The normalized id should be unique * in Datastore, and is suitable for use in email addresses. *//*from w w w. j av a2s .c o m*/ public static String normalizeClientId(String clientId) { return Ascii.toLowerCase(clientId).replaceAll("[^a-z0-9\\-]", ""); }
From source file:google.registry.util.DomainNameUtils.java
/** Canonicalizes a domain name by lowercasing and converting unicode to punycode. */ public static String canonicalizeDomainName(String label) { return Idn.toASCII(Ascii.toLowerCase(label)); }
From source file:com.facebook.buck.ide.intellij.AggregationMode.java
public static AggregationMode fromString(String aggregationModeString) { switch (Ascii.toLowerCase(aggregationModeString)) { case "shallow": return SHALLOW; case "none": return NONE; case "auto": return AUTO; default:/*from w w w .j a va 2 s . c o m*/ try { // See if a number was passed. return new AggregationMode(Integer.parseInt(aggregationModeString)); } catch (NumberFormatException e) { throw new HumanReadableException("Invalid aggregation mode value %s.", aggregationModeString); } } }