Package org.jclouds.functions

Examples of org.jclouds.functions.ToLowerCase


    * try to get the value, then try as lowercase.
    */
   public String getFirstHeaderOrNull(String string) {
      Collection<String> values = headers.get(string);
      if (values.size() == 0) {
         Multimap<String, String> lowerCaseHeaders = Multimaps2.transformKeys(getHeaders(), new ToLowerCase());
         values = lowerCaseHeaders.get(string.toLowerCase());
      }
      return (values.size() >= 1) ? values.iterator().next() : null;
   }
View Full Code Here


    * try to get the value, then try as lowercase.
    */
   public String getFirstHeaderOrNull(String string) {
      Collection<String> values = headers.get(string);
      if (values.size() == 0) {
         Multimap<String, String> lowerCaseHeaders = Multimaps2.transformKeys(getHeaders(), new ToLowerCase());
         values = lowerCaseHeaders.get(string.toLowerCase());
      }
      return (values.size() >= 1) ? values.iterator().next() : null;
   }
View Full Code Here

    * try to get the value, then try as lowercase.
    */
   public String getFirstHeaderOrNull(String string) {
      Collection<String> values = headers.get(string);
      if (values.size() == 0) {
         Multimap<String, String> lowerCaseHeaders = Multimaps2.transformKeys(getHeaders(), new ToLowerCase());
         values = lowerCaseHeaders.get(string.toLowerCase());
      }
      return (values.size() >= 1) ? values.iterator().next() : null;
   }
View Full Code Here

@Test(groups = "unit")
public class Multimaps2Test {
  public void testTransformKeysToLowerCase() {
    Multimap<String, String> map = ImmutableMultimap.of("oNe", "1", "TWO", "2", "three", "3", "Three", "3.0");
    Multimap<String, String> expected = ImmutableMultimap.of("one", "1", "two", "2", "three", "3", "three", "3.0");
    Multimap<String, String> transformed = Multimaps2.transformKeys(map, new ToLowerCase());
   
    assertEquals(transformed, expected);
  }
View Full Code Here

    * try to get the value, then try as lowercase.
    */
   public String getFirstHeaderOrNull(String string) {
      Collection<String> values = headers.get(string);
      if (values.size() == 0) {
         Multimap<String, String> lowerCaseHeaders = Multimaps2.transformKeys(getHeaders(), new ToLowerCase());
         values = lowerCaseHeaders.get(string.toLowerCase());
      }
      return (values.size() >= 1) ? values.iterator().next() : null;
   }
View Full Code Here

@Test(groups = "unit")
public class Multimaps2Test {
  public void testTransformKeysToLowerCase() {
    Multimap<String, String> map = ImmutableMultimap.of("oNe", "1", "TWO", "2", "three", "3", "Three", "3.0");
    Multimap<String, String> expected = ImmutableMultimap.of("one", "1", "two", "2", "three", "3", "three", "3.0");
    Multimap<String, String> transformed = Multimaps2.transformKeys(map, new ToLowerCase());
   
    assertEquals(transformed, expected);
  }
View Full Code Here

    * try to get the value, then try as lowercase.
    */
   public String getFirstHeaderOrNull(String string) {
      Collection<String> values = headers.get(string);
      if (values.size() == 0) {
         Multimap<String, String> lowerCaseHeaders = Multimaps2.transformKeys(getHeaders(), new ToLowerCase());
         values = lowerCaseHeaders.get(string.toLowerCase());
      }
      return (values.size() >= 1) ? values.iterator().next() : null;
   }
View Full Code Here

    * try to get the value, then try as lowercase.
    */
   public String getFirstHeaderOrNull(String string) {
      Collection<String> values = headers.get(string);
      if (values.isEmpty()) {
         Multimap<String, String> lowerCaseHeaders = Multimaps2.transformKeys(getHeaders(), new ToLowerCase());
         values = lowerCaseHeaders.get(string.toLowerCase());
      }
      return (values.size() >= 1) ? values.iterator().next() : null;
   }
View Full Code Here

@Test(groups = "unit")
public class Multimaps2Test {
  public void testTransformKeysToLowerCase() {
    Multimap<String, String> map = ImmutableMultimap.of("oNe", "1", "TWO", "2", "three", "3", "Three", "3.0");
    Multimap<String, String> expected = ImmutableMultimap.of("one", "1", "two", "2", "three", "3", "three", "3.0");
    Multimap<String, String> transformed = Multimaps2.transformKeys(map, new ToLowerCase());
   
    assertEquals(transformed, expected);
  }
View Full Code Here

TOP

Related Classes of org.jclouds.functions.ToLowerCase

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.