Tabnine Logo
String.valueOf
Code IndexAdd Tabnine to your IDE (free)

How to use
valueOf
method
in
java.lang.String

Best Java code snippets using java.lang.String.valueOf (Showing top 20 results out of 166,023)

origin: google/guava

 @Override
 public int compare(T left, T right) {
  return String.valueOf(left).compareTo(String.valueOf(right));
 }
}
origin: square/okhttp

 private List<String> names(List<Certificate> certificates) {
  ArrayList<String> strings = new ArrayList<>();

  for (Certificate cert : certificates) {
   if (cert instanceof X509Certificate) {
    strings.add(String.valueOf(((X509Certificate) cert).getSubjectDN()));
   } else {
    strings.add(cert.getType());
   }
  }

  return strings;
 }
}
origin: square/okhttp

/**
 * Adds a new header with the name and value. This may be used to add multiple headers with the
 * same name.
 */
public MockResponse addHeader(String name, Object value) {
 headers.add(name, String.valueOf(value));
 return this;
}
origin: square/okhttp

/**
 * Adds a new header with the name and value. This may be used to add multiple headers with the
 * same name. Unlike {@link #addHeader(String, Object)} this does not validate the name and
 * value.
 */
public MockResponse addHeaderLenient(String name, Object value) {
 Internal.instance.addLenient(headers, name, String.valueOf(value));
 return this;
}
origin: google/guava

static void fail(Throwable cause, Object message) {
 AssertionFailedError assertionFailedError = new AssertionFailedError(String.valueOf(message));
 assertionFailedError.initCause(cause);
 throw assertionFailedError;
}
origin: google/guava

 @Override
 public String apply(Integer from) {
  return String.valueOf(from);
 }
});
origin: google/guava

 @Override
 public String apply(Integer from) {
  return String.valueOf(from);
 }
}
origin: ReactiveX/RxJava

private static String getStringValue(Object o) {
  if (o == null) {
    return "";
  } else {
    if (o instanceof int[]) {
      return Arrays.toString((int[]) o);
    } else {
      return String.valueOf(o);
    }
  }
}
origin: ReactiveX/RxJava

private static String getStringValue(Object o) {
  if (o == null) {
    return "";
  } else {
    if (o instanceof int[]) {
      return Arrays.toString((int[]) o);
    } else {
      return String.valueOf(o);
    }
  }
}
origin: ReactiveX/RxJava

private static String getStringValue(Object o) {
  if (o == null) {
    return "";
  } else {
    if (o instanceof int[]) {
      return Arrays.toString((int[]) o);
    } else {
      return String.valueOf(o);
    }
  }
}
origin: ReactiveX/RxJava

private static String getStringValue(Object o) {
  if (o == null) {
    return "";
  } else {
    if (o instanceof int[]) {
      return Arrays.toString((int[]) o);
    } else {
      return String.valueOf(o);
    }
  }
}
origin: ReactiveX/RxJava

@Override
public Integer apply(Integer t1) {
  // be slow ... but faster than Thread.sleep(1)
  String t = "";
  int s = sink;
  for (int i = 2000; i >= 0; i--) {
    t = String.valueOf(i + t.hashCode() + s);
  }
  sink = t.hashCode();
  return t1;
}
origin: google/guava

/**
 * Adds a name/value pair to the formatted output in {@code name=value} format.
 *
 * @since 18.0 (since 11.0 as {@code Objects.ToStringHelper.add()}).
 */
@CanIgnoreReturnValue
public ToStringHelper add(String name, float value) {
 return addHolder(name, String.valueOf(value));
}
origin: google/guava

/**
 * Adds a name/value pair to the formatted output in {@code name=value} format.
 *
 * @since 18.0 (since 11.0 as {@code Objects.ToStringHelper.add()}).
 */
@CanIgnoreReturnValue
public ToStringHelper add(String name, int value) {
 return addHolder(name, String.valueOf(value));
}
origin: google/guava

/**
 * Adds a name/value pair to the formatted output in {@code name=value} format.
 *
 * @since 18.0 (since 11.0 as {@code Objects.ToStringHelper.add()}).
 */
@CanIgnoreReturnValue
public ToStringHelper add(String name, long value) {
 return addHolder(name, String.valueOf(value));
}
origin: ReactiveX/RxJava

@Override
public void subscribe(Subscriber<? super String> t1) {
  t1.onSubscribe(new BooleanSubscription());
  System.out.println(count.get() + " @ " + String.valueOf(last - System.currentTimeMillis()));
  last = System.currentTimeMillis();
  if (count.getAndDecrement() == 0) {
    t1.onNext("hello");
    t1.onComplete();
  } else {
    t1.onError(new RuntimeException());
  }
}
origin: google/guava

private static void assertCastFails(long value) {
 try {
  UnsignedBytes.checkedCast(value);
  fail("Cast to byte should have failed: " + value);
 } catch (IllegalArgumentException ex) {
  assertTrue(
    value + " not found in exception text: " + ex.getMessage(),
    ex.getMessage().contains(String.valueOf(value)));
 }
}
origin: ReactiveX/RxJava

@SuppressWarnings("rawtypes")
static String value(Notification notification) {
  if (notification.isOnNext()) {
    return String.valueOf(notification.getValue());
  }
  return "null";
}
origin: ReactiveX/RxJava

@SuppressWarnings("rawtypes")
static String value(Notification notification) {
  if (notification.isOnNext()) {
    return String.valueOf(notification.getValue());
  }
  return "null";
}
origin: ReactiveX/RxJava

@Override
public void subscribe(Observer<? super String> t1) {
  t1.onSubscribe(Disposables.empty());
  System.out.println(count.get() + " @ " + String.valueOf(last - System.currentTimeMillis()));
  last = System.currentTimeMillis();
  if (count.getAndDecrement() == 0) {
    t1.onNext("hello");
    t1.onComplete();
  } else {
    t1.onError(new RuntimeException());
  }
}
java.langStringvalueOf

Javadoc

Returns the string representation of the char argument.

Popular methods of String

  • equals
  • length
    Returns the number of characters in this string.
  • substring
    Returns a string containing a subsequence of characters from this string. The returned string shares
  • startsWith
    Compares the specified string to this string, starting at the specified offset, to determine if the
  • format
    Returns a formatted string, using the supplied format and arguments, localized to the given locale.
  • split
    Splits this string using the supplied regularExpression. See Pattern#split(CharSequence,int) for an
  • trim
  • indexOf
  • endsWith
    Compares the specified string to this string to determine if the specified string is a suffix.
  • toLowerCase
    Converts this string to lower case, using the rules of locale.Most case mappings are unaffected by t
  • contains
    Determines if this String contains the sequence of characters in the CharSequence passed.
  • getBytes
  • contains,
  • getBytes,
  • <init>,
  • equalsIgnoreCase,
  • replace,
  • isEmpty,
  • charAt,
  • hashCode,
  • lastIndexOf

Popular in Java

  • Making http requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getResourceAsStream (ClassLoader)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Socket (java.net)
    Provides a client-side TCP socket.
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now