@Override public String apply(String s) { if (s.equals("x")) { return "xx"; } return s.toUpperCase(); } };
@Override public String apply(String s) { if (s.equals("x")) { return "XX"; } return s.toUpperCase(); } };
@Override public String apply(String s) { if (s.equals("x")) { return "xx"; } return s.toUpperCase(); } };
@Override public String apply(String s) { if (s.equals("x")) { return "XX"; } return s.toUpperCase(); } };
@Override @Nullable public String metaDataSchemaNameToUse(@Nullable String schemaName) { if (schemaName != null) { return super.metaDataSchemaNameToUse(schemaName); } // Use current user schema if no schema specified... String userName = getUserName(); return (userName != null ? userName.toUpperCase() : null); }
@Override @Nullable public String metaDataSchemaNameToUse(@Nullable String schemaName) { if (schemaName != null) { return super.metaDataSchemaNameToUse(schemaName); } // Use current user schema if no schema specified... String userName = getUserName(); return (userName != null ? userName.toUpperCase() : null); }
@Override public Object fromMessage(Message message) throws JMSException, MessageConversionException { String content = ((TextMessage) message).getText(); return content.toUpperCase(); } }
public static TypeCode forName(String name) { String searchingFor = name.toUpperCase(); TypeCode[] tcs = values(); for (int i = 1; i < tcs.length; i++) { if (tcs[i].name().equals(searchingFor)) { return tcs[i]; } } return OBJECT; }
private ServerWebExchange mapExchange(ServerWebExchange exchange, String methodParamValue) { HttpMethod httpMethod = HttpMethod.resolve(methodParamValue.toUpperCase(Locale.ENGLISH)); Assert.notNull(httpMethod, () -> "HttpMethod '" + methodParamValue + "' not supported"); if (ALLOWED_METHODS.contains(httpMethod)) { return exchange.mutate().request(builder -> builder.method(httpMethod)).build(); } else { return exchange; } }
@Override public Message toMessage(Object object, Session session) throws JMSException, MessageConversionException { return new StubTextMessage(object.toString().toUpperCase()); }
@PostMapping("/completable-future") public CompletableFuture<Person> transformCompletableFuture( @RequestBody CompletableFuture<Person> personFuture) { return personFuture.thenApply(person -> new Person(person.getName().toUpperCase())); }
private String getValueFromConfig(ProtocolConfig protocolConfig, String key) { String protocolPrefix = protocolConfig.getName().toUpperCase() + "_"; String port = ConfigUtils.getSystemProperty(protocolPrefix + key); if (StringUtils.isEmpty(port)) { port = ConfigUtils.getSystemProperty(key); } return port; }
private String getValueFromConfig(ProtocolConfig protocolConfig, String key) { String protocolPrefix = protocolConfig.getName().toUpperCase() + "_"; String port = ConfigUtils.getSystemProperty(protocolPrefix + key); if (StringUtils.isEmpty(port)) { port = ConfigUtils.getSystemProperty(key); } return port; }
@PostMapping("/publisher") public Publisher<Person> transformPublisher(@RequestBody Publisher<Person> persons) { return Flux .from(persons) .map(person -> new Person(person.getName().toUpperCase())); }
public void testFromStringFailsWithUpperCaseString() { String string = Hashing.sha1().hashString("foo", Charsets.US_ASCII).toString().toUpperCase(); try { HashCode.fromString(string); fail(); } catch (IllegalArgumentException expected) { } }
@Override public String getAsText() { return ObjectUtils.nullSafeToString(getValue()).toUpperCase(); } }
@PostMapping("/flowable") public Flowable<Person> transformFlowable(@RequestBody Flowable<Person> persons) { return persons.map(person -> new Person(person.getName().toUpperCase())); } }
@PostMapping("/single") public Single<Person> transformSingle(@RequestBody Single<Person> personFuture) { return personFuture.map(person -> new Person(person.getName().toUpperCase())); }
@PostMapping("/rxjava2-maybe") public Maybe<Person> transformRxJava2Maybe(@RequestBody Maybe<Person> personFuture) { return personFuture.map(person -> new Person(person.getName().toUpperCase())); }
@GwtIncompatible // String.toUpperCase() has browser semantics public void testEqualsIgnoreCaseUnicodeEquivalence() { // Note that it's possible in future that the JDK's idea to toUpperCase() or equalsIgnoreCase() // may change and break assumptions in this test [*]. This is not a bug in the implementation of // Ascii.equalsIgnoreCase(), but it is a signal that its documentation may need updating as // regards edge cases. // The Unicode point {@code 00df} is the lowercase form of sharp-S (ß), whose uppercase is "SS". assertEquals("PASSWORD", "pa\u00dfword".toUpperCase()); // [*] assertFalse("pa\u00dfword".equalsIgnoreCase("PASSWORD")); // [*] assertFalse(Ascii.equalsIgnoreCase("pa\u00dfword", "PASSWORD")); } }