
com.iofairy.pattern.mapping.ActionValueMatcherMapping Maven / Gradle / Ivy
/*
* Copyright (C) 2021 iofairy,
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.iofairy.pattern.mapping;
import com.iofairy.lambda.*;
import com.iofairy.pattern.PatternIn;
import com.iofairy.pattern.matcher.ActionValueRMatcher;
import com.iofairy.pattern.matcher.ActionValueVMatcher;
/**
* ActionValue Matcher Mapping
* @since 0.0.1
*/
public class ActionValueMatcherMapping extends PatternMatcherMapping {
protected final R1 super T, V> preAction;
public ActionValueMatcherMapping(V value, R1 super T, V> preAction) {
super(value);
this.preAction = preAction;
}
public ActionValueVMatcher when(T matchValue, V1 super V> action) {
ActionValueVMatcher actionValueVMatcher = new ActionValueVMatcher<>(value, preAction);
return actionValueVMatcher.when(matchValue, action);
}
public ActionValueVMatcher whenNext(T matchValue, V1 super V> action) {
ActionValueVMatcher actionValueVMatcher = new ActionValueVMatcher<>(value, preAction);
return actionValueVMatcher.whenNext(matchValue, action);
}
public ActionValueRMatcher when(T matchValue, R1 super V, ? extends R> action) {
ActionValueRMatcher actionValueRMatcher = new ActionValueRMatcher<>(value, preAction);
return actionValueRMatcher.when(matchValue, action);
}
public ActionValueRMatcher whenNext(T matchValue, R1 super V, ? extends R> action) {
ActionValueRMatcher actionValueRMatcher = new ActionValueRMatcher<>(value, preAction);
return actionValueRMatcher.whenNext(matchValue, action);
}
public ActionValueVMatcher when(PatternIn matchValues, V1 super V> action) {
ActionValueVMatcher actionValueVMatcher = new ActionValueVMatcher<>(value, preAction);
return actionValueVMatcher.when(matchValues, action);
}
public ActionValueVMatcher whenNext(PatternIn matchValues, V1 super V> action) {
ActionValueVMatcher actionValueVMatcher = new ActionValueVMatcher<>(value, preAction);
return actionValueVMatcher.whenNext(matchValues, action);
}
public ActionValueRMatcher when(PatternIn matchValues, R1 super V, ? extends R> action) {
ActionValueRMatcher actionValueRMatcher = new ActionValueRMatcher<>(value, preAction);
return actionValueRMatcher.when(matchValues, action);
}
public ActionValueRMatcher whenNext(PatternIn matchValues, R1 super V, ? extends R> action) {
ActionValueRMatcher actionValueRMatcher = new ActionValueRMatcher<>(value, preAction);
return actionValueRMatcher.whenNext(matchValues, action);
}
public ActionValueVMatcher when(boolean matchValue, V1 super V> action) {
ActionValueVMatcher actionValueVMatcher = new ActionValueVMatcher<>(value, preAction);
return actionValueVMatcher.when(matchValue, action);
}
public ActionValueVMatcher whenNext(boolean matchValue, V1 super V> action) {
ActionValueVMatcher actionValueVMatcher = new ActionValueVMatcher<>(value, preAction);
return actionValueVMatcher.whenNext(matchValue, action);
}
public ActionValueRMatcher when(boolean matchValue, R1 super V, ? extends R> action) {
ActionValueRMatcher actionValueRMatcher = new ActionValueRMatcher<>(value, preAction);
return actionValueRMatcher.when(matchValue, action);
}
public ActionValueRMatcher whenNext(boolean matchValue, R1 super V, ? extends R> action) {
ActionValueRMatcher actionValueRMatcher = new ActionValueRMatcher<>(value, preAction);
return actionValueRMatcher.whenNext(matchValue, action);
}
/*
* ######################################################
* ******************************************************
* ##### MatcherMapping with throwing exception #####
* ******************************************************
* ######################################################
*/
public ActionValueVMatcher with(T matchValue, VT1 super V, E> action) throws E {
ActionValueVMatcher actionValueVMatcher = new ActionValueVMatcher<>(value, preAction);
return actionValueVMatcher.with(matchValue, action);
}
public ActionValueVMatcher withNext(T matchValue, VT1 super V, E> action) throws E {
ActionValueVMatcher actionValueVMatcher = new ActionValueVMatcher<>(value, preAction);
return actionValueVMatcher.withNext(matchValue, action);
}
public ActionValueRMatcher with(T matchValue, RT1 super V, ? extends R, E> action) throws E {
ActionValueRMatcher actionValueRMatcher = new ActionValueRMatcher<>(value, preAction);
return actionValueRMatcher.with(matchValue, action);
}
public ActionValueRMatcher withNext(T matchValue, RT1 super V, ? extends R, E> action) throws E {
ActionValueRMatcher actionValueRMatcher = new ActionValueRMatcher<>(value, preAction);
return actionValueRMatcher.withNext(matchValue, action);
}
public ActionValueVMatcher with(PatternIn matchValues, VT1 super V, E> action) throws E {
ActionValueVMatcher actionValueVMatcher = new ActionValueVMatcher<>(value, preAction);
return actionValueVMatcher.with(matchValues, action);
}
public ActionValueVMatcher withNext(PatternIn matchValues, VT1 super V, E> action) throws E {
ActionValueVMatcher actionValueVMatcher = new ActionValueVMatcher<>(value, preAction);
return actionValueVMatcher.withNext(matchValues, action);
}
public ActionValueRMatcher with(PatternIn matchValues, RT1 super V, ? extends R, E> action) throws E {
ActionValueRMatcher actionValueRMatcher = new ActionValueRMatcher<>(value, preAction);
return actionValueRMatcher.with(matchValues, action);
}
public ActionValueRMatcher withNext(PatternIn matchValues, RT1 super V, ? extends R, E> action) throws E {
ActionValueRMatcher actionValueRMatcher = new ActionValueRMatcher<>(value, preAction);
return actionValueRMatcher.withNext(matchValues, action);
}
public ActionValueVMatcher with(boolean matchValue, VT1 super V, E> action) throws E {
ActionValueVMatcher actionValueVMatcher = new ActionValueVMatcher<>(value, preAction);
return actionValueVMatcher.with(matchValue, action);
}
public ActionValueVMatcher withNext(boolean matchValue, VT1 super V, E> action) throws E {
ActionValueVMatcher actionValueVMatcher = new ActionValueVMatcher<>(value, preAction);
return actionValueVMatcher.withNext(matchValue, action);
}
public ActionValueRMatcher with(boolean matchValue, RT1 super V, ? extends R, E> action) throws E {
ActionValueRMatcher actionValueRMatcher = new ActionValueRMatcher<>(value, preAction);
return actionValueRMatcher.with(matchValue, action);
}
public ActionValueRMatcher withNext(boolean matchValue, RT1 super V, ? extends R, E> action) throws E {
ActionValueRMatcher actionValueRMatcher = new ActionValueRMatcher<>(value, preAction);
return actionValueRMatcher.withNext(matchValue, action);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy