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

com.github.rauberprojects.client.context.factory.ContextFactory Maven / Gradle / Ivy

package com.github.rauberprojects.client.context.factory;

import com.github.rauberprojects.client.context.Context;

public interface ContextFactory {

    /**
     * Implementations MUST NOT return null from this method, instead they are advised to raise an appropriate exception.
     * Additionally, it is not guaranteed that the {@link ContextFactory#canCreate(Object)} method is called before this method.
     *
     * @param source The response entity.
     * @return The new context instance.
     * @throws ContextCreationException if the Context could not be created
     */
    Context create(Source source);

    /**
     * @param source The response entity.
     * @return True if the {@link ContextFactory} can create the a new context from the given source.
     */
    boolean canCreate(Source source);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy