001package gudusoft.gsqlparser.lineage.v2.model;
002
003import java.util.Arrays;
004import java.util.Collections;
005import java.util.List;
006import java.util.Map;
007
008/**
009 * One input of a TargetFieldOccurrence (Section 4.4). Generated from the schema definition Input by
010 * scripts/sqllr/gen_type_model.py; do not edit.
011 *
012 * @since 4.2.17
013 */
014public final class Input extends SqllrObject {
015
016    /** The members the schema defines, in schema order. */
017    public static final List<String> MEMBERS = Collections.unmodifiableList(Arrays.asList("kind", "factRef", "factCandidateRef", "disclosure", "literal", "token", "parameterRef", "parameterText", "parameterOrdinal", "sequenceRef", "extensions"));
018
019    /** The members the schema requires. */
020    public static final List<String> REQUIRED = Collections.unmodifiableList(Arrays.<String>asList("kind"));
021
022    /** Reads a JSON object as a {@code Input}. */
023    public static final Reader<Input> READER = new Reader<Input>() {
024        @Override
025        public Input read(Object json) {
026            return fromJson(json);
027        }
028    };
029
030    private Input(Map<String, Object> members) {
031        super(members);
032    }
033
034    /** A {@code Input} with the members of a JSON object, all kept. */
035    public static Input fromJson(Object json) {
036        return new Input(members(json, "Input"));
037    }
038
039    public static Builder builder() {
040        return new Builder(null);
041    }
042
043    /** A builder holding every member of this object. */
044    public Builder toBuilder() {
045        return new Builder(toJson());
046    }
047
048    /**
049     * The member {@code kind}. The kind of an input of a TargetFieldOccurrence. Registry group
050     * 'inputKinds' (Section 4.4). Null when absent; throws IllegalStateException when the member
051     * holds another JSON type.
052     */
053    public String getKind() {
054        return string("kind");
055    }
056
057    /**
058     * The member {@code factRef}. FIELD_REF: the Fact (of any kind) through which the field flows.
059     * A document-local reference: an integer that is unique across the whole document (one
060     * reference space for every object that carries a ref). Local references are assigned after
061     * merging and have no meaning outside the document (Sections 6.1 and 13). Null when absent;
062     * throws IllegalStateException when the member holds another JSON type.
063     */
064    public Long getFactRef() {
065        return integer("factRef");
066    }
067
068    /**
069     * The member {@code factCandidateRef}. FIELD_REF: the FactCandidate whose target end is or
070     * contains the written field; the write is then at most PARTIAL (algorithms/fold-v1.md, Section
071     * 7.4). A document-local reference: an integer that is unique across the whole document (one
072     * reference space for every object that carries a ref). Local references are assigned after
073     * merging and have no meaning outside the document (Sections 6.1 and 13). Null when absent;
074     * throws IllegalStateException when the member holds another JSON type.
075     */
076    public Long getFactCandidateRef() {
077        return integer("factCandidateRef");
078    }
079
080    /**
081     * The member {@code disclosure}. How the value of a CONSTANT input is carried. Registry group
082     * 'constantValueDisclosure' (Section 4.4). Null when absent; throws IllegalStateException when
083     * the member holds another JSON type.
084     */
085    public String getDisclosure() {
086        return string("disclosure");
087    }
088
089    /**
090     * The member {@code literal}. CONSTANT with disclosure PRESENT: the literal as written, after
091     * redaction. Null when absent; throws IllegalStateException when the member holds another JSON
092     * type.
093     */
094    public String getLiteral() {
095        return string("literal");
096    }
097
098    /**
099     * The member {@code token}. CONSTANT with disclosure HASHED. Null when absent; throws
100     * IllegalStateException when the member holds another JSON type.
101     */
102    public KeyedToken getToken() {
103        return typed("token", KeyedToken.READER);
104    }
105
106    /**
107     * The member {@code parameterRef}. PARAMETER: the PARAMETER or VARIABLE endpoint. A
108     * document-local reference: an integer that is unique across the whole document (one reference
109     * space for every object that carries a ref). Local references are assigned after merging and
110     * have no meaning outside the document (Sections 6.1 and 13). Null when absent; throws
111     * IllegalStateException when the member holds another JSON type.
112     */
113    public Long getParameterRef() {
114        return integer("parameterRef");
115    }
116
117    /**
118     * The member {@code parameterText}. PARAMETER: the parameter marker or name as written, when it
119     * is not modelled as an endpoint. Null when absent; throws IllegalStateException when the
120     * member holds another JSON type.
121     */
122    public String getParameterText() {
123        return string("parameterText");
124    }
125
126    /**
127     * The member {@code parameterOrdinal}. PARAMETER with parameterText "?": the position of the
128     * anonymous marker among the statement's anonymous markers, 0-based in text order; two
129     * anonymous markers are two parameters (algorithms/fold-v1.md, Section 7.5). A 0-based ordinal.
130     * Null when absent; throws IllegalStateException when the member holds another JSON type.
131     */
132    public Long getParameterOrdinal() {
133        return integer("parameterOrdinal");
134    }
135
136    /**
137     * The member {@code sequenceRef}. SEQUENCE_VALUE: the SEQUENCE endpoint, when known. A
138     * document-local reference: an integer that is unique across the whole document (one reference
139     * space for every object that carries a ref). Local references are assigned after merging and
140     * have no meaning outside the document (Sections 6.1 and 13). Null when absent; throws
141     * IllegalStateException when the member holds another JSON type.
142     */
143    public Long getSequenceRef() {
144        return integer("sequenceRef");
145    }
146
147    /**
148     * The member {@code extensions}. Extension data keyed by namespace. Every core object may carry
149     * it; it never takes part in a core identity. Null when absent; throws IllegalStateException
150     * when the member holds another JSON type.
151     */
152    public Map<String, Extension> getExtensions() {
153        return typed("extensions", mapOf(Extension.READER));
154    }
155
156    /** Collects the members of a new {@code Input}. */
157    public static final class Builder extends SqllrObject.Builder<Input, Builder> {
158        private Builder(Map<String, Object> from) {
159            super(from);
160        }
161
162        /** Sets the member {@code kind}; null removes it. */
163        public Builder kind(String value) {
164            return set("kind", value);
165        }
166
167        /** Sets the member {@code factRef}; null removes it. */
168        public Builder factRef(Long value) {
169            return set("factRef", value);
170        }
171
172        /** Sets the member {@code factCandidateRef}; null removes it. */
173        public Builder factCandidateRef(Long value) {
174            return set("factCandidateRef", value);
175        }
176
177        /** Sets the member {@code disclosure}; null removes it. */
178        public Builder disclosure(String value) {
179            return set("disclosure", value);
180        }
181
182        /** Sets the member {@code literal}; null removes it. */
183        public Builder literal(String value) {
184            return set("literal", value);
185        }
186
187        /** Sets the member {@code token}; null removes it. */
188        public Builder token(KeyedToken value) {
189            return set("token", value);
190        }
191
192        /** Sets the member {@code parameterRef}; null removes it. */
193        public Builder parameterRef(Long value) {
194            return set("parameterRef", value);
195        }
196
197        /** Sets the member {@code parameterText}; null removes it. */
198        public Builder parameterText(String value) {
199            return set("parameterText", value);
200        }
201
202        /** Sets the member {@code parameterOrdinal}; null removes it. */
203        public Builder parameterOrdinal(Long value) {
204            return set("parameterOrdinal", value);
205        }
206
207        /** Sets the member {@code sequenceRef}; null removes it. */
208        public Builder sequenceRef(Long value) {
209            return set("sequenceRef", value);
210        }
211
212        /** Sets the member {@code extensions}; null removes it. */
213        public Builder extensions(Map<String, Extension> value) {
214            return set("extensions", value);
215        }
216
217        @Override
218        public Input build() {
219            return new Input(frozenMembers());
220        }
221    }
222}