001package gudusoft.gsqlparser.ir.semantic.catalog;
002
003/**
004 * Slice 76 — minimal column descriptor inside a {@link Catalog}.
005 *
006 * <p>Carries only the column name. Column types, nullability, defaults,
007 * and identifier-quoting policy are intentionally absent: slice 76 is the
008 * smallest DTO that lets external callers supply catalog metadata to
009 * {@link gudusoft.gsqlparser.ir.semantic.SqlSemanticAnalyzer#analyze
010 * SqlSemanticAnalyzer.analyze} without depending on the internal
011 * {@code gudusoft.gsqlparser.sqlenv.TSQLEnv} type. A later slice will
012 * extend this when concrete consumers exercise the gaps.
013 *
014 * <p>Identifier semantics (case folding, quoted vs unquoted, vendor
015 * rules) are delegated to {@code TSQLEnv} via the analyzer's internal
016 * bridge — names are stored exactly as written by the caller.
017 *
018 * <p>This class is immutable and safe to share across threads.
019 */
020public final class CatalogColumn {
021
022    private final String name;
023
024    /**
025     * @param name the column name as written by the caller; must be non-null
026     *             and non-empty.
027     * @throws IllegalArgumentException when {@code name} is {@code null} or empty.
028     */
029    public CatalogColumn(String name) {
030        if (name == null) {
031            throw new IllegalArgumentException("column name must not be null");
032        }
033        if (name.isEmpty()) {
034            throw new IllegalArgumentException("column name must not be empty");
035        }
036        this.name = name;
037    }
038
039    public String getName() {
040        return name;
041    }
042
043    @Override
044    public String toString() {
045        return "CatalogColumn{name=" + name + "}";
046    }
047}