Class Candidate

java.lang.Object
org.jline.reader.Candidate
All Implemented Interfaces:
Comparable<Candidate>

public class Candidate extends Object implements Comparable<Candidate>
Represents a completion candidate for tab completion.

A Candidate encapsulates all the information needed to display and apply a completion suggestion. This includes the actual text to be inserted, how it should be displayed to the user, grouping information, descriptions, and other metadata that controls how the candidate behaves when selected.

Candidates are created by Completer implementations and passed to the LineReader, which then filters, sorts, and displays them to the user when tab completion is requested.

Each candidate has several properties:

  • value - The actual text to be inserted when the candidate is selected
  • display - How the candidate should be displayed to the user (may include ANSI styling)
  • group - Optional grouping category for organizing related candidates
  • description - Optional help text explaining the candidate
  • suffix - Optional text to append when the candidate is selected
  • complete - Whether the candidate is a complete word or may be further expanded
See Also: