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

org.mockito.internal.creation.bytebuddy.MockFeatures Maven / Gradle / Ivy

There is a newer version: 5.12.0
Show newest version
/*
 * Copyright (c) 2016 Mockito contributors
 * This program is made available under the terms of the MIT License.
 */
package org.mockito.internal.creation.bytebuddy;

import java.util.Collections;
import java.util.Set;

import org.mockito.mock.SerializableMode;
import org.mockito.stubbing.Answer;

class MockFeatures {

    final Class mockedType;
    final Set> interfaces;
    final SerializableMode serializableMode;
    final boolean stripAnnotations;
    final Answer defaultAnswer;

    private MockFeatures(
            Class mockedType,
            Set> interfaces,
            SerializableMode serializableMode,
            boolean stripAnnotations,
            Answer defaultAnswer) {
        this.mockedType = mockedType;
        this.interfaces = Collections.unmodifiableSet(interfaces);
        this.serializableMode = serializableMode;
        this.stripAnnotations = stripAnnotations;
        this.defaultAnswer = defaultAnswer;
    }

    public static  MockFeatures withMockFeatures(
            Class mockedType,
            Set> interfaces,
            SerializableMode serializableMode,
            boolean stripAnnotations,
            Answer defaultAnswer) {
        return new MockFeatures(
                mockedType, interfaces, serializableMode, stripAnnotations, defaultAnswer);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy