List of usage examples for java.lang String toUpperCase
public String toUpperCase()
From source file:eu.trentorise.smartcampus.communicatorservice.manager.Utils.java
public static CloudToPushType checkCloudToPushType(String conf) { String result = conf.toUpperCase(); for (CloudToPushType x : CloudToPushType.values()) { if (x.name().compareTo(result) == 0) { return x; }// w w w .j a va 2 s . c o m } return CloudToPushType.GOOGLE; }
From source file:xyz.cloudbans.entities.response.ResponseStatus.java
@JsonCreator public static ResponseStatus create(String name) { return ResponseStatus.valueOf(name.toUpperCase()); }
From source file:Main.java
public static String makeIntentExtraName(Class<?> cls, String extraName) { return String.format("%s.EXTRA_%s", cls.getSimpleName(), extraName.toUpperCase()); }
From source file:com.hpcloud.mon.common.model.alarm.AggregateFunction.java
@JsonCreator public static AggregateFunction fromJson(String text) { return valueOf(text.toUpperCase()); }
From source file:com.music.util.SecurityUtils.java
/** * Calculates a HmacSHA1 value// ww w . j ava 2 s. c o m * * @param data * @param key * @return HmacSHA1 */ public static String hmac(String data, String key) { try { // get an hmac_sha1 key from the raw key bytes SecretKeySpec signingKey = new SecretKeySpec(key.getBytes(), HMAC_SHA1_ALGORITHM); Mac mac = Mac.getInstance(HMAC_SHA1_ALGORITHM); mac.init(signingKey); // compute the hmac on input data bytes byte[] rawHmac = mac.doFinal(data.getBytes()); String result = new String(Hex.encodeHex(rawHmac)); return result.toUpperCase(); } catch (Exception ex) { throw new RuntimeException("Problem with calculating hmac", ex); } }
From source file:com.nexmo.client.voice.VoiceName.java
@JsonCreator public static VoiceName fromString(String name) { return VoiceName.valueOf(name.toUpperCase()); }
From source file:Main.java
public static String u2s(String u) { Pattern pat = Pattern.compile("[\\\\U|\\\\u]([0-9a-fA-F]{4})"); Matcher mat = pat.matcher(u); while (mat.find()) { String HEX = mat.group(1); char v = (char) (Integer.parseInt(HEX.toUpperCase(), 16)); mat = pat.matcher(u = u.replace("\\" + mat.group(), "" + v)); }/*from ww w. j av a 2s . co m*/ return u; }
From source file:Main.java
public static byte ConvertStringToHexByte(String StringToConvert) { StringToConvert = StringToConvert.toUpperCase(); char[] CharArray = StringToConvert.toCharArray(); char[] Char = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; int result = 0; for (int i = 0; i <= 1; i++) { for (int j = 0; j <= 15; j++) { if (CharArray[i] == Char[j]) { if (i == 1) { result = result + j; j = 15;// ww w . j a v a 2 s . c o m } else if (i == 0) { result = result + j * 16; j = 15; } } } } return (byte) result; }
From source file:org.immutables.fixture.SillyMarshalingRoutines.java
public static SillyValue unmarshal(JsonParser parser, @Nullable SillyValue enumNull, Class<SillyValue> expectedClass) throws IOException { String text = parser.getText(); return SillyValue.valueOf(text.toUpperCase()); }
From source file:io.thekraken.grok.configuration.model.InputType.java
public static boolean isValid(String value) { return EnumUtils.isValidEnum(InputType.class, value.toUpperCase()); }