org.mockito.internal.creation.bytebuddy.MockFeatures Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mockito-core Show documentation
Show all versions of mockito-core Show documentation
Mockito mock objects library core API and implementation
/*
* 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);
}
}