Java 8 Boolean - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 Boolean class.

This code example shows how to use the following methods:
 * to reset the global / suite level cluster if a test fails but don't wanna reset it 
 * for every subsequent test. 
 */ 
public class CurrentTestFailedMarker extends RunListener { 
 
    private static final AtomicBoolean failed = new AtomicBoolean(false);
 
    @Override 
    public void testFailure(Failure failure) throws Exception {
        failed.set(true);
    } 
 
    @Override 
    public void testStarted(Description description) throws Exception {
        failed.set(false);
    } 
 
    /** 
     * Returns <code>true</code> iff the previously executed test failed. Otherwise <code>false</code> 
     */ 
8
CodeRank
This code example shows how to use the following methods:
 * @see org.elasticsearch.env.NodeEnvironment 
 */ 
public abstract class ShardLock implements Closeable {
 
    private final ShardId shardId;
    private final AtomicBoolean closed = new AtomicBoolean(false);
 
    public ShardLock(ShardId id) {
        this.shardId = id;
    } 
 
    /** 
     * Returns the locks shards Id. 
     */ 
    public final ShardId getShardId() { 
        return shardId;
    } 
 
    @Override 
    public final void close() throws IOException {
8
CodeRank
This code example shows how to use the following methods:get, set
        return this;
    } 
 
    @Override 
    public void invalidate() { 
        if (!valid.get()) throw new IllegalStateException();
        valid.set(false);
    } 
 
    @Override 
    public boolean isNew() { 
        if (!valid.get()) throw new IllegalStateException();
        return false; 
    } 
 
 
} 
7
CodeRank
This code example shows how to use the following methods:get
     * Start indexing 
     * 
     * @param numOfDocs number of document to index before pausing. Set to -1 to have no limit. 
     */ 
    public void start(int numOfDocs) {
        assert !stop.get() : "background indexer can not be started after it has stopped";
        setBudget(numOfDocs);
        startLatch.countDown();
    } 
 
    /** Pausing indexing by setting current document limit to 0 */ 
    public void pauseIndexing() { 
        availableBudget.drainPermits();
        setBudget(0); 
    } 
 
    /** Continue indexing after it has paused. No new document limit will be set */ 
    public void continueIndexing() { 
        continueIndexing(-1); 
    } 
8
CodeRank
This code example shows how to use the following methods:
	public PullToRefreshWebView2(Context context, Mode mode) {
		super(context, mode);
	} 
 
	private JsValueCallback mJsCallback;
	private final AtomicBoolean mIsReadyForPullDown = new AtomicBoolean(false);
	private final AtomicBoolean mIsReadyForPullUp = new AtomicBoolean(false);
 
	@Override 
	protected WebView createRefreshableView(Context context, AttributeSet attrs) {
		WebView webView = super.createRefreshableView(context, attrs);
 
		// Need to add JS Interface so we can get the response back 
		mJsCallback = new JsValueCallback();
		webView.addJavascriptInterface(mJsCallback, JS_INTERFACE_PKG);
 
		return webView;
	} 
 
	@Override 
8
CodeRank
This code example shows how to use the following methods:
 
	private final ServletServerHttpResponse response;
 
	private AsyncContext asyncContext;
 
	private AtomicBoolean asyncCompleted = new AtomicBoolean(false);
 
 
	/** 
	 * Constructor accepting a request and response pair that are expected to be of type 
	 * {@link ServletServerHttpRequest} and {@link ServletServerHttpResponse} 
	 * respectively. 
	 */ 
	public ServletServerHttpAsyncRequestControl(ServletServerHttpRequest request, ServletServerHttpResponse response) {
		Assert.notNull(request, "request is required");
		Assert.notNull(response, "response is required");
 
		Assert.isTrue(request.getServletRequest().isAsyncSupported(),
				"Async support must be enabled on a servlet and for all filters involved " + 
				"in async request processing. This is done in Java code using the Servlet API " + 
8
CodeRank
This code example shows how to use the following methods:
 
	private Long timeout;
 
	private AsyncContext asyncContext;
 
	private AtomicBoolean asyncCompleted = new AtomicBoolean(false);
 
	private final List<Runnable> timeoutHandlers = new ArrayList<Runnable>();
 
	private final List<Runnable> completionHandlers = new ArrayList<Runnable>();
 
 
	/** 
	 * Create a new instance for the given request/response pair. 
	 * @param request current HTTP request 
	 * @param response current HTTP response 
	 */ 
	public StandardServletAsyncWebRequest(HttpServletRequest request, HttpServletResponse response) {
		super(request, response);
	} 
8
CodeRank
This code example shows how to use the following methods:
 
	private final Collection<String> destinationPrefixes;
 
	private ApplicationEventPublisher eventPublisher;
 
	private AtomicBoolean brokerAvailable = new AtomicBoolean(false);
 
	private final BrokerAvailabilityEvent availableEvent = new BrokerAvailabilityEvent(true, this);
 
	private final BrokerAvailabilityEvent notAvailableEvent = new BrokerAvailabilityEvent(false, this);
 
	private boolean autoStartup = true;
 
	private volatile boolean running = false;
 
	private final Object lifecycleMonitor = new Object(); 
 
	private final ChannelInterceptor unsentDisconnectInterceptor = new UnsentDisconnectChannelInterceptor();
 
 
8
CodeRank
This code example shows how to use the following methods:get
        this.outbound = outbound;
    } 
 
    @Override 
    public boolean isOpen() { 
        return isOpen.get();
    } 
 
    @Override 
    public WebSocket write(String s) throws IOException {
        logger.trace("WebSocket.write() for {}", uuid); 
        outbound.writeTextMessage(CharBuffer.wrap(s));
        return this;
    } 
 
    @Override 
    public WebSocket write(byte[] b, int offset, int length) throws IOException {
        logger.trace("WebSocket.write() for {}", uuid); 
        outbound.writeBinaryMessage(ByteBuffer.wrap(b, offset, length));
        return this;
8
CodeRank
This code example shows how to use the following methods:
    static final int BACKGROUND_DEXOPT_JOB = 800;
    private static ComponentName sDexoptServiceName = new ComponentName(
            "android", 
            BackgroundDexOptService.class.getName());
 
    final AtomicBoolean mIdleTime = new AtomicBoolean(false);
 
    public static void schedule(Context context) {
        JobScheduler js = (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE);
        JobInfo job = new JobInfo.Builder(BACKGROUND_DEXOPT_JOB, sDexoptServiceName)
                .setRequiresDeviceIdle(true) 
                .setRequiresCharging(true) 
                .build(); 
        js.schedule(job);
    } 
 
    @Override 
    public boolean onStartJob(JobParameters params) {
        Log.i(TAG, "onIdleStart");
        final PackageManagerService pm =
8
CodeRank

Related Java 8 Boolean Questions & Answers:

Other Java 8 Boolean Examples

1:	
2:	Boolean isInternetPresent = cd.isConnectingToInternet(); // true or false
3:

Read More

16:		 * */
17:		public void showAlertDialog(Context context, String title, String message,
18:				Boolean status) {
19:			AlertDialog alertDialog = new AlertDialog.Builder(context).create();
20:

Read More

14:		 * */
15:		public void showAlertDialog(Context context, String title, String message,
16:				Boolean status) {
17:			AlertDialog alertDialog = new AlertDialog.Builder(context).create();
18:

Read More

See Code Examples for Java 8 Boolean Methods: