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

How to use
toHexString
method
in
java.lang.Integer

Best Java code snippets using java.lang.Integer.toHexString (Showing top 20 results out of 42,633)

origin: apache/incubator-dubbo

protected String codeName(int ch) {
  if (ch < 0)
    return "end of file";
  else
    return "0x" + Integer.toHexString(ch & 0xff) + " (" + (char) +ch + ")";
}
origin: apache/incubator-dubbo

protected String codeName(int ch) {
  if (ch < 0)
    return "end of file";
  else
    return "0x" + Integer.toHexString(ch & 0xff) + " (" + (char) +ch + ")";
}
origin: apache/incubator-dubbo

protected String codeName(int ch) {
  if (ch < 0)
    return "end of file";
  else
    return "0x" + Integer.toHexString(ch & 0xff);
}
origin: skylot/jadx

private String getString(int strId) {
  if (0 <= strId && strId < strings.length) {
    return strings[strId];
  }
  return "NOT_FOUND_STR_0x" + Integer.toHexString(strId);
}
origin: spring-projects/spring-framework

/**
 * Return a hex String form of an object's identity hash code.
 * @param obj the object
 * @return the object's identity code in hex notation
 */
public static String getIdentityHexString(Object obj) {
  return Integer.toHexString(System.identityHashCode(obj));
}
origin: netty/netty

/**
 * Creates a new group with a generated name and the provided {@link EventExecutor} to notify the
 * {@link ChannelGroupFuture}s. {@code stayClosed} defines whether or not, this group can be closed
 * more than once. Adding channels to a closed group will immediately close them, too. This makes it
 * easy, to shutdown server and child channels at once.
 */
public DefaultChannelGroup(EventExecutor executor, boolean stayClosed) {
  this("group-0x" + Integer.toHexString(nextId.incrementAndGet()), executor, stayClosed);
}
origin: libgdx/libgdx

/** Returns the color encoded as hex string with the format RRGGBBAA. */
public String toString () {
  String value = Integer
    .toHexString(((int)(255 * r) << 24) | ((int)(255 * g) << 16) | ((int)(255 * b) << 8) | ((int)(255 * a)));
  while (value.length() < 8)
    value = "0" + value;
  return value;
}
origin: spring-projects/spring-framework

/**
 * Build an identification String for the given {@link DataSource},
 * primarily for logging purposes.
 * @param dataSource the {@code DataSource} to introspect
 * @return the identification String
 */
private String identify(DataSource dataSource) {
  return dataSource.getClass().getName() + '@' + Integer.toHexString(dataSource.hashCode());
}
origin: skylot/jadx

private void throwException(String error, int expected, int actual) throws IOException {
  throw new IOException(error
      + ", expected: 0x" + Integer.toHexString(expected)
      + ", actual: 0x" + Integer.toHexString(actual)
      + ", offset: 0x" + Long.toHexString(getPos()));
}
origin: google/guava

private static @Nullable String convertDottedQuadToHex(String ipString) {
 int lastColon = ipString.lastIndexOf(':');
 String initialPart = ipString.substring(0, lastColon + 1);
 String dottedQuad = ipString.substring(lastColon + 1);
 byte[] quad = textToNumericFormatV4(dottedQuad);
 if (quad == null) {
  return null;
 }
 String penultimate = Integer.toHexString(((quad[0] & 0xff) << 8) | (quad[1] & 0xff));
 String ultimate = Integer.toHexString(((quad[2] & 0xff) << 8) | (quad[3] & 0xff));
 return initialPart + penultimate + ":" + ultimate;
}
origin: google/guava

 private static String lenientToString(@Nullable Object o) {
  try {
   return String.valueOf(o);
  } catch (Exception e) {
   // Default toString() behavior - see Object.toString()
   String objectToString =
     o.getClass().getName() + '@' + Integer.toHexString(System.identityHashCode(o));
   // Logger is created inline with fixed name to avoid forcing Proguard to create another class.
   Logger.getLogger("com.google.common.base.Strings")
     .log(WARNING, "Exception during lenientFormat for " + objectToString, e);
   return "<" + objectToString + " threw " + e.getClass().getName() + ">";
  }
 }
}
origin: skylot/jadx

  @Override
  public String toString() {
    return "AccessInfo: " + type + " 0x" + Integer.toHexString(accFlags) + " (" + rawString() + ")";
  }
}
origin: google/guava

int decode(char ch) throws DecodingException {
 if (ch > Ascii.MAX) {
  throw new DecodingException("Unrecognized character: 0x" + Integer.toHexString(ch));
 }
 int result = decodabet[ch];
 if (result == -1) {
  if (ch <= 0x20 || ch == Ascii.MAX) {
   throw new DecodingException("Unrecognized character: 0x" + Integer.toHexString(ch));
  } else {
   throw new DecodingException("Unrecognized character: " + ch);
  }
 }
 return result;
}
origin: skylot/jadx

private String prepareNamePart(String name) {
  if (name.length() > maxLength) {
    return "x" + Integer.toHexString(name.hashCode());
  }
  if (!NameMapper.isAllCharsPrintable(name)) {
    return removeInvalidChars(name);
  }
  return name;
}
origin: libgdx/libgdx

private void checkError () {
  int error = 0;
  if ((error = gl.getError()) != GL_NO_ERROR) {
    throw new GdxRuntimeException("GL error: " + error + ", " + Integer.toHexString(error));
  }
}
origin: spring-projects/spring-framework

@Test
public void parseNumberAsHex() {
  String aByte = "0x" + Integer.toHexString(Byte.valueOf(Byte.MAX_VALUE).intValue());
  String aShort = "0x" + Integer.toHexString(Short.valueOf(Short.MAX_VALUE).intValue());
  String anInteger = "0x" + Integer.toHexString(Integer.MAX_VALUE);
  String aLong = "0x" + Long.toHexString(Long.MAX_VALUE);
  String aReallyBigInt = "FEBD4E677898DFEBFFEE44";
  assertByteEquals(aByte);
  assertShortEquals(aShort);
  assertIntegerEquals(anInteger);
  assertLongEquals(aLong);
  assertEquals("BigInteger did not parse",
      new BigInteger(aReallyBigInt, 16), NumberUtils.parseNumber("0x" + aReallyBigInt, BigInteger.class));
}
origin: square/okhttp

private void readMessageFrame() throws IOException {
 int opcode = this.opcode;
 if (opcode != OPCODE_TEXT && opcode != OPCODE_BINARY) {
  throw new ProtocolException("Unknown opcode: " + toHexString(opcode));
 }
 readMessage();
 if (opcode == OPCODE_TEXT) {
  frameCallback.onReadMessage(messageFrameBuffer.readUtf8());
 } else {
  frameCallback.onReadMessage(messageFrameBuffer.readByteString());
 }
}
origin: spring-projects/spring-framework

@Test
public void testCustomNumberEditorWithHex() {
  CustomNumberEditor editor = new CustomNumberEditor(Integer.class, false);
  editor.setAsText("0x" + Integer.toHexString(64));
  assertEquals(new Integer(64), editor.getValue());
}
origin: google/guava

public void testWhitespaceBreakingWhitespaceSubset() throws Exception {
 for (int c = 0; c <= Character.MAX_VALUE; c++) {
  if (breakingWhitespace().matches((char) c)) {
   assertTrue(Integer.toHexString(c), whitespace().matches((char) c));
  }
 }
}
origin: skylot/jadx

  public void check() {
    assertEquals(null, test("n", null));
    assertEquals("n=7", test("n", "7"));
    assertEquals("n=77", test("n", "0x" + Integer.toHexString(77)));
    assertEquals("Failed to parse number", test("n", "abc"));
    assertEquals("Failed to parse number", test("n", "0xabX"));
  }
}
java.langIntegertoHexString

Javadoc

Converts the specified integer into its hexadecimal string representation. The returned string is a concatenation of characters from '0' to '9' and 'a' to 'f'.

Popular methods of Integer

  • parseInt
    Parses the specified string as a signed integer value using the specified radix. The ASCII character
  • toString
    Converts the specified signed integer into a string representation based on the specified radix. The
  • 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.
  • 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

  • Finding current android device location
  • notifyDataSetChanged (ArrayAdapter)
  • getResourceAsStream (ClassLoader)
  • findViewById (Activity)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top plugins for WebStorm
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