Codota Logo
com.palantir.util
Code IndexAdd Codota to your IDE (free)

How to use com.palantir.util

Best Java code snippets using com.palantir.util (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
origin: palantir/atlasdb

/**
 * Returns an input stream that reads from the bytes in this stream.
 * Only bytes written to the stream before calling this method are
 * available to the input stream.
 */
public InputStream getInputStream() {
  return new Input(size());
}
origin: palantir/atlasdb

@Override
public void clearCacheAndStats() {
  cache.clear();
  clear();
}
origin: palantir/atlasdb

  static <T> VersionedType<T> of(T value, long version) {
    return ImmutableVersionedType.<T>builder().value(value).version(version).build();
  }
}
origin: palantir/atlasdb

/**
 * Returns a pair with the left and right reversed.
 * @return
 */
public Pair<W, V> getReversed() {
  return create(rhSide, lhSide);
}
origin: palantir/atlasdb

public void markNumResultsNotDeleted(int resultsInBatch) {
  numNotDeleted += resultsInBatch;
  AssertUtils.assertAndLog(log, numNotDeleted <= numReturned,
      "NotDeleted is bigger than the number of results we returned.");
}
origin: palantir/atlasdb

/**
 * Returns a new <code>Pair</code> instance
 * with the given left-side and right-side objects.
 */
public static <V, W> Pair<V, W> create(V v, W w) {
  return new Pair<V, W>(v, w);
}
origin: palantir/atlasdb

public SoftCache(int initialSize) {
  cacheEntries = createCache(initialSize);
  setName("SoftCache");
  SoftCache.registerForCleanup(this);
}
origin: palantir/atlasdb

public static void assertAndLog(Logger log, boolean cheapTest, String msg) {
  if (!cheapTest) {
    assertAndLogWithException(log, false, msg, getDebuggingException());
  }
}
origin: palantir/atlasdb

  /**
   * Creates a new Mutable with a null value to start with.
   */
  public static <T> Mutable<T> newMutable() {
    return newMutable(null);
  }
}
origin: palantir/atlasdb

@Override
public T getValue() {
  return delegate.get().value();
}
origin: palantir/atlasdb

/**
 * Make sure to get a unique name on this object before trying to register this cache with JMX.
 * If it doens't have a unique name, then it won't be registered correctly.
 */
public void registerMBean() {
  registerMBean(getStatBeanName());
}
origin: palantir/atlasdb

/**
 * Constructs a new <code>MutuallyExclusiveSetLock</code> that will
 * lock the objects in the order determined by <code>comparator</code>.
 * @param fair when <code>true</code>, the class favors granting access to the
 *             longest-waiting thread when there is any contention.
 *             When <code>false</code>, no access order is guaranteed.
 * @param comparator a <code>java.util.Comparator</code> to use in determining lock order.
 */
public static <T> MutuallyExclusiveSetLock<T> createWithComparator(boolean fair, Comparator<? super T> comparator) {
  return new MutuallyExclusiveSetLock<T>(fair, comparator);
}
origin: palantir/atlasdb

  /**
   * Unlocks the objects acquired from locking.
   * This method should always be in a try/finally block immediately after the lock.
   * If you try to unlock from another thread, no objects are unlocked.
   * @see #lockOnObjects(Iterable)
   */
  public void unlock() {
    setLock.unlock(this);
  }
}
origin: palantir/atlasdb

  public VersionedType<T> getVersionedValue() {
    return delegate.get();
  }
}
origin: palantir/atlasdb

  private VersionedType<Long> constantNumber() {
    return VersionedType.of(1L, 0);
  }
}
origin: palantir/atlasdb

@Override
public void write(int b) throws IOException {
  ensureCapacity(outputPos);
  bytes[outputPos++] = (byte) b;
}
origin: palantir/atlasdb

@Override
public synchronized boolean containsKey(K key) {
  V val = get(key);
  return (val != null);
}
origin: palantir/atlasdb

/**
 * Type-inferred factory method for {@link Mutable}
 */
public static <T> Mutable<T> newMutable(T val) {
  return new Mutable<T>(val);
}
origin: palantir/atlasdb

/**
 * Returns a new <code>Pair</code> with the right hand side set to the passed value.
 */
public <T> Pair<V, T> withRhSide(T newRhSide) {
  return Pair.create(lhSide, newRhSide);
}
origin: palantir/atlasdb

/**
 * Return a new <code>Pair</code> with the left hand side set to the passed value.
 */
public <T> Pair<T, W> withLhSide(T newLhSide) {
  return Pair.create(newLhSide, rhSide);
}
com.palantir.util

Most used classes

  • Pair
    A generic class for handling pairs of things.
  • Sha256Hash
    A SHA-256 hash. This class provides type-safety and equals/hashCode implementations.
  • AssertUtils
  • TokenBackedBasicResultsPage
    Represents a results page that is backed by TOKEN.
  • SimpleTokenBackedResultsPage
  • Mutable,
  • Mutables,
  • ThreadDumps,
  • OperationTimer$TimingState,
  • OperationTimer,
  • AggregatingVersionedSupplier,
  • CachedComposedSupplier,
  • JMXUtils,
  • OptionalResolver,
  • ByteArrayIOStream,
  • MutuallyExclusiveSetLock,
  • SqlCallStats,
  • SqlStats,
  • VerboseSQLException
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now