All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.iofairy.pattern.mapping.ValueMatcherMapping Maven / Gradle / Ivy

Go to download

Functional Programming for Java 8+ and compatible with the modular system of Java 9+.

There is a newer version: 0.5.10
Show newest version
/*
 * 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.ValueRMatcher;
import com.iofairy.pattern.matcher.ValueVMatcher;

/**
 * Value Matcher Mapping
 * @since 0.0.1
 */
public class ValueMatcherMapping extends PatternMatcherMapping {
    public ValueMatcherMapping(V value) {
        super(value);
    }

    public ValueVMatcher when(V matchValue, V1 action) {
        ValueVMatcher valueVMatcher = new ValueVMatcher<>(value);
        return valueVMatcher.when(matchValue, action);
    }

    public ValueVMatcher whenNext(V matchValue, V1 action) {
        ValueVMatcher valueVMatcher = new ValueVMatcher<>(value);
        return valueVMatcher.whenNext(matchValue, action);
    }

    public  ValueRMatcher when(V matchValue, R1 action) {
        ValueRMatcher valueRMatcher = new ValueRMatcher<>(value);
        return valueRMatcher.when(matchValue, action);
    }

    public  ValueRMatcher whenNext(V matchValue, R1 action) {
        ValueRMatcher valueRMatcher = new ValueRMatcher<>(value);
        return valueRMatcher.whenNext(matchValue, action);
    }

    public ValueVMatcher when(PatternIn matchValues, V1 action) {
        ValueVMatcher valueVMatcher = new ValueVMatcher<>(value);
        return valueVMatcher.when(matchValues, action);
    }

    public ValueVMatcher whenNext(PatternIn matchValues, V1 action) {
        ValueVMatcher valueVMatcher = new ValueVMatcher<>(value);
        return valueVMatcher.whenNext(matchValues, action);
    }

    public  ValueRMatcher when(PatternIn matchValues, R1 action) {
        ValueRMatcher valueRMatcher = new ValueRMatcher<>(value);
        return valueRMatcher.when(matchValues, action);
    }

    public  ValueRMatcher whenNext(PatternIn matchValues, R1 action) {
        ValueRMatcher valueRMatcher = new ValueRMatcher<>(value);
        return valueRMatcher.whenNext(matchValues, action);
    }

    public ValueVMatcher when(boolean matchValue, V1 action) {
        ValueVMatcher valueVMatcher = new ValueVMatcher<>(value);
        return valueVMatcher.when(matchValue, action);
    }

    public ValueVMatcher whenNext(boolean matchValue, V1 action) {
        ValueVMatcher valueVMatcher = new ValueVMatcher<>(value);
        return valueVMatcher.whenNext(matchValue, action);
    }

    public  ValueRMatcher when(boolean matchValue, R1 action) {
        ValueRMatcher valueRMatcher = new ValueRMatcher<>(value);
        return valueRMatcher.when(matchValue, action);
    }

    public  ValueRMatcher whenNext(boolean matchValue, R1 action) {
        ValueRMatcher valueRMatcher = new ValueRMatcher<>(value);
        return valueRMatcher.whenNext(matchValue, action);
    }

    /*
     * ######################################################
     * ******************************************************
     * #####   MatcherMapping with throwing exception   #####
     * ******************************************************
     * ######################################################
     */
    public  ValueVMatcher with(V matchValue, VT1 action) throws E {
        ValueVMatcher valueVMatcher = new ValueVMatcher<>(value);
        return valueVMatcher.with(matchValue, action);
    }

    public  ValueVMatcher withNext(V matchValue, VT1 action) throws E {
        ValueVMatcher valueVMatcher = new ValueVMatcher<>(value);
        return valueVMatcher.withNext(matchValue, action);
    }

    public  ValueRMatcher with(V matchValue, RT1 action) throws E {
        ValueRMatcher valueRMatcher = new ValueRMatcher<>(value);
        return valueRMatcher.with(matchValue, action);
    }

    public  ValueRMatcher withNext(V matchValue, RT1 action) throws E {
        ValueRMatcher valueRMatcher = new ValueRMatcher<>(value);
        return valueRMatcher.withNext(matchValue, action);
    }

    public  ValueVMatcher with(PatternIn matchValues, VT1 action) throws E {
        ValueVMatcher valueVMatcher = new ValueVMatcher<>(value);
        return valueVMatcher.with(matchValues, action);
    }

    public  ValueVMatcher withNext(PatternIn matchValues, VT1 action) throws E {
        ValueVMatchervalueVMatcher = new ValueVMatcher<>(value);
        return valueVMatcher.withNext(matchValues, action);
    }

    public  ValueRMatcher with(PatternIn matchValues, RT1 action) throws E {
        ValueRMatcher valueRMatcher = new ValueRMatcher<>(value);
        return valueRMatcher.with(matchValues, action);
    }

    public  ValueRMatcher withNext(PatternIn matchValues, RT1 action) throws E {
        ValueRMatcher valueRMatcher = new ValueRMatcher<>(value);
        return valueRMatcher.withNext(matchValues, action);
    }

    public  ValueVMatcher with(boolean matchValue, VT1 action) throws E {
        ValueVMatcher valueVMatcher = new ValueVMatcher<>(value);
        return valueVMatcher.with(matchValue, action);
    }

    public  ValueVMatcher withNext(boolean matchValue, VT1 action) throws E {
        ValueVMatcher valueVMatcher = new ValueVMatcher<>(value);
        return valueVMatcher.withNext(matchValue, action);
    }

    public  ValueRMatcher with(boolean matchValue, RT1 action) throws E {
        ValueRMatcher valueRMatcher = new ValueRMatcher<>(value);
        return valueRMatcher.with(matchValue, action);
    }

    public  ValueRMatcher withNext(boolean matchValue, RT1 action) throws E {
        ValueRMatcher valueRMatcher = new ValueRMatcher<>(value);
        return valueRMatcher.withNext(matchValue, action);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy