Tabnine Logo
Integer.toString
Code IndexAdd Tabnine to your IDE (free)

How to use
toString
method
in
java.lang.Integer

Best Java code snippets using java.lang.Integer.toString (Showing top 20 results out of 98,901)

origin: google/guava

 @Override
 public String toString() {
  return Integer.toString(value);
 }
}
origin: ReactiveX/RxJava

  @Override
  public String apply(Integer v) throws Exception {
    return v.toString();
  }
}).test().assertResult("1");
origin: square/okhttp

 private String factor(int n) {
  for (int i = 2; i < n; i++) {
   int x = n / i;
   if (x * i == n) return factor(x) + " × " + i;
  }
  return Integer.toString(n);
 }
};
origin: square/okhttp

 private String factor(int n) {
  for (int i = 2; i < n; i++) {
   int x = n / i;
   if (x * i == n) return factor(x) + " × " + i;
  }
  return Integer.toString(n);
 }
};
origin: ReactiveX/RxJava

@Override
public String apply(String s, Integer n) {
  return s + n.toString();
}
origin: ReactiveX/RxJava

@Override
public String apply(String s, Integer n) {
  return s + n.toString();
}
origin: google/guava

 @Override
 public String toString() {
  return Integer.toString(value);
 }
}
origin: google/guava

 @Override
 public String toString() {
  return Integer.toString(value);
 }
}
origin: google/guava

 @Override
 public String toString() {
  return Integer.toString(value);
 }
}
origin: google/guava

 @Override
 public String load(Integer key) throws Exception {
  if (count.getAndIncrement() == 0) {
   throw e;
  }
  return key.toString();
 }
};
origin: spring-projects/spring-framework

public Obj3(int... params) {
  StringBuilder b = new StringBuilder();
  for (int param: params) {
    b.append(Integer.toString(param));
  }
  output = b.toString();
}
origin: google/guava

public void testParseUnsignedByteWithRadix() throws NumberFormatException {
 // We can easily afford to test this exhaustively.
 for (int radix = Character.MIN_RADIX; radix <= Character.MAX_RADIX; radix++) {
  for (int i = 0; i <= 0xff; i++) {
   assertEquals((byte) i, UnsignedBytes.parseUnsignedByte(Integer.toString(i, radix), radix));
  }
  assertParseFails(Integer.toString(1000, radix), radix);
  assertParseFails(Integer.toString(-1, radix), radix);
  assertParseFails(Integer.toString(-128, radix), radix);
  assertParseFails(Integer.toString(256, radix), radix);
 }
}
origin: spring-projects/spring-framework

  public Future<String> returnSomething(int i) {
    assertTrue(!Thread.currentThread().getName().equals(originalThreadName));
    return new AsyncResult<>(Integer.toString(i));
  }
}
origin: spring-projects/spring-framework

  @Override
  public Future<String> returnSomething(int i) {
    assertTrue(!Thread.currentThread().getName().equals(originalThreadName));
    return new AsyncResult<>(Integer.toString(i));
  }
}
origin: spring-projects/spring-framework

@Async
public ListenableFuture<String> returnSomethingListenable(int i) {
  assertTrue(!Thread.currentThread().getName().equals(originalThreadName));
  if (i == 0) {
    throw new IllegalArgumentException();
  }
  else if (i < 0) {
    return AsyncResult.forExecutionException(new IOException());
  }
  return new AsyncResult<>(Integer.toString(i));
}
origin: google/guava

 @GwtIncompatible // SerializableTester
 private static <Y> void checkCanReserializeSingleton(Function<? super String, Y> f) {
  Function<? super String, Y> g = SerializableTester.reserializeAndAssert(f);
  assertSame(f, g);
  for (Integer i = 1; i < 5; i++) {
   assertEquals(f.apply(i.toString()), g.apply(i.toString()));
  }
 }
}
origin: google/guava

public void testToStringWithRadix() {
 // We can easily afford to test this exhaustively.
 for (int radix = Character.MIN_RADIX; radix <= Character.MAX_RADIX; radix++) {
  for (int i = 0; i <= 0xff; i++) {
   assertEquals(Integer.toString(i, radix), UnsignedBytes.toString((byte) i, radix));
  }
 }
}
origin: google/guava

public void testToString() {
 // We can easily afford to test this exhaustively.
 for (int i = 0; i <= 0xff; i++) {
  assertEquals(Integer.toString(i), UnsignedBytes.toString((byte) i));
 }
}
origin: google/guava

public void testZipInfiniteWithInfinite() {
 // zip is doing an infinite zip, but we truncate the result so we can actually test it
 // but we want the zip itself to work
 assertThat(
     Streams.zip(
         Stream.iterate(1, i -> i + 1).map(String::valueOf),
         Stream.iterate(1, i -> i + 1),
         (String str, Integer i) -> str.equals(Integer.toString(i)))
       .limit(100))
   .doesNotContain(false);
}
origin: google/guava

public void testParseUnsignedByte() {
 // We can easily afford to test this exhaustively.
 for (int i = 0; i <= 0xff; i++) {
  assertEquals((byte) i, UnsignedBytes.parseUnsignedByte(Integer.toString(i)));
 }
 assertParseFails("1000");
 assertParseFails("-1");
 assertParseFails("-128");
 assertParseFails("256");
}
java.langIntegertoString

Javadoc

Returns a String object representing this Integer's value. The value is converted to signed decimal representation and returned as a string, exactly as if the integer value were given as an argument to the java.lang.Integer#toString(int) method.

Popular methods of Integer

  • parseInt
    Parses the specified string as a signed integer value using the specified radix. The ASCII character
  • valueOf
    Parses the specified string as a signed integer value using the specified radix.
  • intValue
    Gets the primitive value of this int.
  • <init>
    Constructs a new Integer from the specified string.
  • toHexString
    Returns a string representation of the integer argument as an unsigned integer in base 16.The unsign
  • equals
    Compares this instance with the specified object and indicates if they are equal. In order to be equ
  • compareTo
    Compares this Integer object to another object. If the object is an Integer, this function behaves l
  • hashCode
  • compare
    Compares two int values.
  • longValue
    Returns the value of this Integer as along.
  • decode
    Parses the specified string and returns a Integer instance if the string can be decoded into an inte
  • numberOfLeadingZeros
    Determines the number of leading zeros in the specified integer prior to the #highestOneBit(int).
  • decode,
  • numberOfLeadingZeros,
  • getInteger,
  • doubleValue,
  • toBinaryString,
  • byteValue,
  • bitCount,
  • shortValue,
  • highestOneBit

Popular in Java

  • Making http requests using okhttp
  • startActivity (Activity)
  • putExtra (Intent)
  • compareTo (BigDecimal)
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Collectors (java.util.stream)
  • JFileChooser (javax.swing)
  • Top Sublime Text plugins
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