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

net.sf.expectit.matcher.MultiResultImpl Maven / Gradle / Ivy

package net.sf.expectit.matcher;

/*
 * #%L
 * net.sf.expectit
 * %%
 * Copyright (C) 2014 Alexey Gavrilov
 * %%
 * 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.
 * #L%
 */

import net.sf.expectit.MultiResult;
import net.sf.expectit.Result;

import java.util.Collections;
import java.util.List;

/**
 * A matcher implementation for multiple operation.
 *
 * @author Alexey Gavrilov
 */
class MultiResultImpl implements MultiResult {
    private final List results;
    private final Result delegate;

    public MultiResultImpl(Result delegate, List results) {
        this.delegate = delegate;
        this.results = results;
    }

    @Override
    public boolean isSuccessful() {
        return delegate.isSuccessful();
    }

    @Override
    public String getBefore() {
        return delegate.getBefore();
    }

    @Override
    public int start() {
        return delegate.start();
    }

    @Override
    public int start(int group) {
        return delegate.start(group);
    }

    @Override
    public int end() {
        return delegate.end();
    }

    @Override
    public int end(int group) {
        return delegate.end(group);
    }

    @Override
    public String group() {
        return delegate.group();
    }

    @Override
    public String group(int group) {
        return delegate.group(group);
    }

    @Override
    public int groupCount() {
        return delegate.groupCount();
    }

    @Override
    public List getResults() {
        return Collections.unmodifiableList(results);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy