public class

VerifiedDeque

extends Object
java.lang.Object
   ↳ com.pnfsoftware.jeb.util.collect.VerifiedDeque<E>

Class Overview

Deque wrapper providing verification facility on push.

Summary

Nested Classes
interface VerifiedDeque.FailureHandler<E> Failure handler for VerifiedDeque
Public Methods
boolean push(E e)
Validate and eventually push/bail/raise an element to the wrapped deque.
static <E> VerifiedDeque<E> wrap(Deque<E> deque, Collection<E> whitelist, Collection<E> blacklist, FailureHandler<E> failureHandler)
Wrap a double-ended queue to support validation on push.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public boolean push (E e)

Validate and eventually push/bail/raise an element to the wrapped deque.

Returns
Throws
IllegalArgumentException refer to VerifiedDeque.FailureHandler

public static VerifiedDeque<E> wrap (Deque<E> deque, Collection<E> whitelist, Collection<E> blacklist, FailureHandler<E> failureHandler)

Wrap a double-ended queue to support validation on push.

Parameters
deque a queue to be wrapped
whitelist optional white-list; if null, all elements are deemed good by default
blacklist optional black-list; if null, no element is deemed bad by default
failureHandler optional handler; if not provided, illegal pushes will raise