Example usage for com.google.common.base Preconditions checkState

List of usage examples for com.google.common.base Preconditions checkState

Introduction

In this page you can find the example usage for com.google.common.base Preconditions checkState.

Prototype

public static void checkState(boolean expression) 

Source Link

Document

Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.

Usage

From source file:org.opendaylight.netconf.sal.connect.netconf.listener.UncancellableFuture.java

@Override
protected boolean setException(final Throwable throwable) {
    Preconditions.checkState(uncancellable);
    return super.setException(throwable);
}

From source file:com.facebook.buck.util.ChunkAccumulator.java

private void push(String chunk) {
    Preconditions.checkState(chunk.getBytes(charset).length <= available());
    chunks.add(chunk);
    size += chunk.getBytes(charset).length;
}