TaskAttributeFactory: Consistently cache predicates

Refactor the match() methods to share code better.

Add a new ThrowingProvider interface that has concrete implementations
that can either store a real value or an exception to be thrown.

Change-Id: Ib27f69748dcae57724a38199212a4ff145e44994
2 files changed