Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/ConditionalInterruptibleTransformer.java')
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/ConditionalInterruptibleTransformer.java58
1 files changed, 0 insertions, 58 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/ConditionalInterruptibleTransformer.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/ConditionalInterruptibleTransformer.java
deleted file mode 100644
index 3d28cc5b57..0000000000
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/ConditionalInterruptibleTransformer.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013, 2016 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.internal.transformer;
-
-import org.eclipse.jpt.common.utility.transformer.InterruptibleTransformer;
-import org.eclipse.jpt.common.utility.internal.ObjectTools;
-import org.eclipse.jpt.common.utility.predicate.Predicate;
-
-/**
- * @see ConditionalTransformer
- */
-public class ConditionalInterruptibleTransformer<I, O>
- implements InterruptibleTransformer<I, O>
-{
- private final Predicate<? super I> predicate;
- private final InterruptibleTransformer<? super I, ? extends O> trueTransformer;
- private final InterruptibleTransformer<? super I, ? extends O> falseTransformer;
-
- public ConditionalInterruptibleTransformer(Predicate<? super I> predicate, InterruptibleTransformer<? super I, ? extends O> trueTransformer, InterruptibleTransformer<? super I, ? extends O> falseTransformer) {
- super();
- if ((predicate == null) || (trueTransformer == null) || (falseTransformer == null)) {
- throw new NullPointerException();
- }
- this.predicate = predicate;
- this.trueTransformer = trueTransformer;
- this.falseTransformer = falseTransformer;
- }
-
- public O transform(I input) throws InterruptedException {
- return this.predicate.evaluate(input) ?
- this.trueTransformer.transform(input) :
- this.falseTransformer.transform(input);
- }
-
- public Predicate<? super I> getPredicate() {
- return this.predicate;
- }
-
- public InterruptibleTransformer<? super I, ? extends O> getTrueTransformer() {
- return this.trueTransformer;
- }
-
- public InterruptibleTransformer<? super I, ? extends O> getFalseTransformer() {
- return this.falseTransformer;
- }
-
- @Override
- public String toString() {
- return ObjectTools.toString(this, this.predicate);
- }
-}

Back to the top