Tabnine Logo
Long.parseUnsignedLong
Code IndexAdd Tabnine to your IDE (free)

How to use
parseUnsignedLong
method
in
java.lang.Long

Best Java code snippets using java.lang.Long.parseUnsignedLong (Showing top 20 results out of 468)

origin: wildfly/wildfly

/**
 * Construct a new instance from a decimal string.
 *
 * @param id the ID of the principal, as a string
 * @throws NumberFormatException if the number is not a valid non-negative long integer
 */
public NumericPrincipal(final String id) throws NumberFormatException {
  this(Long.parseUnsignedLong(id));
}
origin: stackoverflow.com

Long l1 = Long.parseUnsignedLong("17916881237904312345");
origin: stackoverflow.com

long l = Long.parseUnsignedLong("FFFFFFFFFFFFFFFF", 16);
origin: stackoverflow.com

 static long values = Long.parseUnsignedLong("18446744073709551615");

public static void main(String[] args) {
  System.out.println(values); // -1
  System.out.println(Long.toUnsignedString(values)); // 18446744073709551615
}
origin: vavr-io/vavr

/**
 * Parses this {@code CharSeq} as a unsigned decimal long by calling {@link Long#parseUnsignedLong(String)}.
 * <p>
 * We write
 *
 * <pre><code>
 * long value = charSeq.parseUnsignedLong();
 * </code></pre>
 *
 * instead of
 *
 * <pre><code>
 * long value = Long.parseUnsignedLong(charSeq.mkString());
 * </code></pre>
 *
 * @return the unsigned long value represented by this {@code CharSeq} in decimal
 * @throws NumberFormatException If this {@code CharSeq} does not contain a parsable unsigned long.
 */
@GwtIncompatible
public long parseUnsignedLong() {
  return Long.parseUnsignedLong(back);
}
origin: vavr-io/vavr

/**
 * Parses this {@code CharSeq} as a unsigned long in the specified radix
 * by calling {@link Long#parseUnsignedLong(String, int)}.
 * <p>
 * We write
 *
 * <pre><code>
 * long value = charSeq.parseUnsignedLong(radix);
 * </code></pre>
 *
 * instead of
 *
 * <pre><code>
 * long value = Long.parseUnsignedLong(charSeq.mkString(), radix);
 * </code></pre>
 *
 * @param radix the radix to be used in interpreting this {@code CharSeq}
 * @return the unsigned long value represented by this {@code CharSeq} in the specified radix
 * @throws NumberFormatException If this {@code CharSeq} does not contain a parsable unsigned long.
 */
@GwtIncompatible
public long parseUnsignedLong(int radix) {
  return Long.parseUnsignedLong(back, radix);
}
origin: checkstyle/checkstyle

result = Long.parseUnsignedLong(txt, radix);
origin: apache/incubator-gobblin

 /**
  * Test error with bad cipher
  */
 @Test(expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp = ".*BadCipher.*")
 public void badCipher() throws IOException, PGPException {
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  OutputStream os = GPGFileEncryptor.encryptFile(baos, getClass().getResourceAsStream(PUBLIC_KEY),
    Long.parseUnsignedLong(KEY_ID, 16), "BadCipher");
 }
}
origin: apache/incubator-gobblin

/**
 * Encrypt a test string with an asymmetric key and check that it can be decrypted
 * @throws IOException
 * @throws PGPException
 */
@Test
public void encryptAsym() throws IOException, PGPException {
 ByteArrayOutputStream baos = new ByteArrayOutputStream();
 OutputStream os = GPGFileEncryptor.encryptFile(baos, getClass().getResourceAsStream(PUBLIC_KEY),
   Long.parseUnsignedLong(KEY_ID, 16), "CAST5");
 os.write(EXPECTED_FILE_CONTENT_BYTES);
 os.close();
 baos.close();
 byte[] encryptedBytes = baos.toByteArray();
 try (InputStream is = GPGFileDecryptor.decryptFile(new ByteArrayInputStream(encryptedBytes),
   getClass().getResourceAsStream(PRIVATE_KEY), PASSPHRASE)) {
  byte[] decryptedBytes = IOUtils.toByteArray(is);
  Assert.assertNotEquals(EXPECTED_FILE_CONTENT_BYTES, encryptedBytes);
  Assert.assertEquals(EXPECTED_FILE_CONTENT_BYTES, decryptedBytes);
 }
}
origin: apache/incubator-gobblin

   keyName == null ? 0 : Long.parseUnsignedLong(keyName, 16), cipherName);
default:
 log.debug("Do not support encryption type {}", algorithm);
origin: apache/metron

private void initialize() {
 start = Long.parseUnsignedLong(configuration.get(START_TS_CONF));
 end = Long.parseUnsignedLong(configuration.get(END_TS_CONF));
 width = Long.parseLong(configuration.get(WIDTH_CONF));
}
origin: apache/metron

/**
 * Gets unsigned long timestamp from the PCAP filename
 *
 * @return timestamp, or null if unable to parse
 */
public static Long getTimestamp(String pcapFilename) {
 String[] tokens = stripPrefix(pcapFilename).split("_");
 try {
  return Long.parseUnsignedLong(tokens[tokens.length - 3]);
 } catch (NumberFormatException e) {
  return null;
 }
}
origin: stackoverflow.com

 String binaryString = Long.toBinaryString(Long.MIN_VALUE);
long smallestLongPossibleInJava = Long.parseUnsignedLong(binaryString, 2);
origin: DV8FromTheWorld/JDA

public static long parseSnowflake(String input)
{
  Checks.notEmpty(input, "ID");
  try
  {
    if (!input.startsWith("-")) // if not negative -> parse unsigned
      return Long.parseUnsignedLong(input);
    else // if negative -> parse normal
      return Long.parseLong(input);
  }
  catch (NumberFormatException ex)
  {
    throw new NumberFormatException(
      String.format("The specified ID is not a valid snowflake (%s). Expecting a valid long value!", input));
  }
}
origin: apache/metron

@Override
protected void setup(Context context) throws IOException, InterruptedException {
 super.setup(context);
 filter = PcapFilters.valueOf(context.getConfiguration().get(PcapFilterConfigurator.PCAP_FILTER_NAME_CONF)).create();
 filter.configure(context.getConfiguration());
 start = Long.parseUnsignedLong(context.getConfiguration().get(START_TS_CONF));
 end = Long.parseUnsignedLong(context.getConfiguration().get(END_TS_CONF));
}
origin: Discord4J/Discord4J

/**
 * Removes an object from the cache.
 *
 * @param id The ID of the object to remove.
 * @return The object that was removed.
 */
default Optional<T> remove(String id) {
  return remove(Long.parseUnsignedLong(id));
}
origin: Discord4J/Discord4J

private CustomEmojiToken(MessageTokenizer tokenizer, int startIndex, int endIndex) {
  super(tokenizer, startIndex, endIndex);
  final String content = getContent();
  final long emojiId = Long.parseUnsignedLong(content.substring(content.lastIndexOf(":") + 1, content.lastIndexOf('>')));
  emoji = tokenizer.getClient().getGuilds().stream()
      .map(guild -> guild.getEmojiByID(emojiId)).filter(Objects::nonNull).findFirst()
      .orElse(null);
}
origin: Discord4J/Discord4J

  private RoleMentionToken(MessageTokenizer tokenizer, int startIndex, int endIndex) {
    super(tokenizer, startIndex, endIndex, null);
    mention = tokenizer.getClient().getRoleByID(Long.parseUnsignedLong(getContent().replace("<@&", "").replace(">", "")));
  }
}
origin: Discord4J/Discord4J

private void guildRoleDelete(GuildRoleDeleteEventResponse event) {
  Guild guild = (Guild) client.getGuildByID(Long.parseUnsignedLong(event.guild_id));
  if (guild != null) {
    IRole role = guild.getRoleByID(Long.parseUnsignedLong(event.role_id));
    if (role != null) {
      guild.roles.remove(role);
      client.dispatcher.dispatch(new RoleDeleteEvent(role));
    }
  }
}
origin: Discord4J/Discord4J

private void userUpdate(UserUpdateEventResponse event) {
  User newUser = (User) client.getUserByID(Long.parseUnsignedLong(event.id));
  if (newUser != null) {
    IUser oldUser = newUser.copy();
    newUser = DiscordUtils.getUserFromJSON(shard, event);
    client.dispatcher.dispatch(new UserUpdateEvent(oldUser, newUser));
  }
}
java.langLongparseUnsignedLong

Popular methods of Long

  • parseLong
    Parses the string argument as a signed long in the radix specified by the second argument. The chara
  • toString
    Returns a string representation of the first argument in the radix specified by the second argument.
  • valueOf
    Returns a Long object holding the value extracted from the specified String when parsed with the rad
  • longValue
    Returns the value of this Long as a long value.
  • <init>
    Constructs a newly allocated Long object that represents the long value indicated by the String para
  • intValue
    Returns the value of this Long as an int.
  • equals
    Compares this object to the specified object. The result is true if and only if the argument is not
  • hashCode
  • toHexString
    Returns a string representation of the longargument as an unsigned integer in base 16.The unsigned l
  • compareTo
    Compares this Long object to another object. If the object is a Long, this function behaves likecomp
  • compare
    Compares two long values numerically. The value returned is identical to what would be returned by:
  • doubleValue
    Returns the value of this Long as a double.
  • compare,
  • doubleValue,
  • decode,
  • numberOfLeadingZeros,
  • numberOfTrailingZeros,
  • bitCount,
  • signum,
  • reverseBytes,
  • toBinaryString,
  • shortValue

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • requestLocationUpdates (LocationManager)
  • compareTo (BigDecimal)
  • Menu (java.awt)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Best IntelliJ 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