001package javax.visrec.ml.classification; 002 003import javax.visrec.spi.ServiceProvider; 004 005/** 006 * Builder to create @{link Classifier} 007 * 008 * @author Kevin Berendsen 009 * @since 1.0 010 * @Deprecated for removal 011 */ 012@Deprecated 013public abstract class ClassifierBuilder { 014 015 protected ClassifierBuilder() { 016 // Prevent instantiation outside of subclasses. 017 } 018 019 /** 020 * Set the trained model to be used during the image classification. 021 * 022 * TODO Add the proper class to the method signature. 023 * 024 * @param trainedModel the object of the trained model. 025 * @return current builder instance 026 */ 027 public abstract ClassifierBuilder trainedModel(Object trainedModel); 028 029 /** 030 * Create the {@link Classifier} that is able to use {@code sourceClss} as input/source type and 031 * {@code returnCls} as return type of the {@link Classifier} 032 * 033 * @param sourceCls {@link Class} object of the incoming input/source. 034 * @param returnCls {@link Class} object of the return type of the {@link Classifier} 035 * @param <T> source type class of the {@link Classifier} 036 * @param <R> return type class of the {@link Classifier} 037 * @return {@link Classifier} object. 038 */ 039 public abstract <T, R> Classifier<T, R> buildWithSourceType(final Class<T> sourceCls, final Class<R> returnCls); 040 041 /** 042 * Create the {@link Classifier} that is able to use {@code sourceClss} as input/source type and 043 * {@link String} as default return type of the {@link Classifier} 044 * 045 * @param sourceCls {@link Class} object of the incoming input/source. 046 * @param <T> source type class of the {@link Classifier} 047 * @return {@link Classifier} object. 048 */ 049 public final <T> Classifier<T, String> buildWithSourceType(final Class<T> sourceCls) { 050 return buildWithSourceType(sourceCls, String.class); 051 } 052}