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

org.wisepersist.gwtmockito.ng.fakes.FakeProvider Maven / Gradle / Ivy

/*
 * Copyright (c) 2013 Google Inc.
 * Copyright (c) 2016 WisePersist.org
 *
 * 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 org.wisepersist.gwtmockito.ng.fakes;

import org.wisepersist.gwtmockito.ng.GwtMockito;

/**
 * Interface implemented by an object capable of providing fake instances of a
 * given type. Instances of this interface must be registered via
 * {@link GwtMockito#useProviderForType}.
 *
 * @author [email protected] (Erik Kuefler)
 * @param  Type that this interface can provide.
 */
public interface FakeProvider {

  /**
   * Returns a fake implementation of the given type.
   *
   * @param type The actual type passed to GWT.create. Usually this is the same
   *     as T, but it could be a subtype or a completely unrelated type depending
   *     on how {@link GwtMockito#useProviderForType} was called.
   * @return The faked object.
   */
  T getFake(Class type);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy