// Path: src/main/java/com/github/liblevenshtein/transducer/Candidate.java
// @Value
// public class Candidate implements Serializable {
// 
//   private static final long serialVersionUID = 1L;
// 
//   /**
//    * Candidate term from the dictionary automaton.
//    * @return Candidate term from the dictionary automaton.
//    */
//   private final String term;
// 
//   /**
//    * Distance between the candidate term and the query term.
//    * @return Distance between the candidate term and the query term.
//    */
//   private final int distance;
// }


import java.io.Serializable;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import com.github.liblevenshtein.transducer.Candidate;
package com.github.liblevenshtein.transducer.factory;




/**
 * Builds spelling candidates of the requested type, optionally including the
 * distance of the candidate from the query term.
 * @author Dylon Edwards
 * @param <CandidateType> Kind of spelling candidate built by this factory.
 * @since 2.1.2
 */
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public abstract class CandidateFactory<CandidateType> implements Serializable {

  private static final long serialVersionUID = 1L;

  /**
   * Builds a new spelling candidate from the dictionary term and its
   * Levenshtein distance from the query term.
   * @param term Candidate term from the dictionary.
   * @param distance Levenshtein distance of the dictionary term from the query
   *   term.
   * @return A new spelling candidate, optionally with the distance included.
   */
  public abstract CandidateType build(String term, int distance);

  /**
   * Builds instances of {@link Candidate}, with the dictionary term and its
   * Levenshtein distance from the query term.
   * @author Dylon Edwards
   * @since 2.1.2
   */
// Path: src/main/java/com/github/liblevenshtein/transducer/Candidate.java
// @Value
// public class Candidate implements Serializable {
// 
//   private static final long serialVersionUID = 1L;
// 
//   /**
//    * Candidate term from the dictionary automaton.
//    * @return Candidate term from the dictionary automaton.
//    */
//   private final String term;
// 
//   /**
//    * Distance between the candidate term and the query term.
//    * @return Distance between the candidate term and the query term.
//    */
//   private final int distance;
// }


// Path: src/main/java/com/github/liblevenshtein/transducer/factory/CandidateFactory.java
import java.io.Serializable;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import com.github.liblevenshtein.transducer.Candidate;

package com.github.liblevenshtein.transducer.factory;




/**
 * Builds spelling candidates of the requested type, optionally including the
 * distance of the candidate from the query term.
 * @author Dylon Edwards
 * @param <CandidateType> Kind of spelling candidate built by this factory.
 * @since 2.1.2
 */
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public abstract class CandidateFactory<CandidateType> implements Serializable {

  private static final long serialVersionUID = 1L;

  /**
   * Builds a new spelling candidate from the dictionary term and its
   * Levenshtein distance from the query term.
   * @param term Candidate term from the dictionary.
   * @param distance Levenshtein distance of the dictionary term from the query
   *   term.
   * @return A new spelling candidate, optionally with the distance included.
   */
  public abstract CandidateType build(String term, int distance);

  /**
   * Builds instances of {@link Candidate}, with the dictionary term and its
   * Levenshtein distance from the query term.
   * @author Dylon Edwards
   * @since 2.1.2
   */
  public static class WithDistance extends CandidateFactory<Candidate> {