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 * A nested field path segment. Module nested-fields, defined later; open. Generated from the schema 010 * definition PathSegment by scripts/sqllr/gen_type_model.py; do not edit. 011 * 012 * @since 4.2.17 013 */ 014public final class PathSegment extends SqllrObject { 015 016 /** The members the schema defines, in schema order. */ 017 public static final List<String> MEMBERS = Collections.unmodifiableList(Arrays.asList("kind")); 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 PathSegment}. */ 023 public static final Reader<PathSegment> READER = new Reader<PathSegment>() { 024 @Override 025 public PathSegment read(Object json) { 026 return fromJson(json); 027 } 028 }; 029 030 private PathSegment(Map<String, Object> members) { 031 super(members); 032 } 033 034 /** A {@code PathSegment} with the members of a JSON object, all kept. */ 035 public static PathSegment fromJson(Object json) { 036 return new PathSegment(members(json, "PathSegment")); 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 a nested field path segment. Registry group 050 * 'pathSegmentKinds' (Section 7.4). Null when absent; throws IllegalStateException when the 051 * member holds another JSON type. 052 */ 053 public String getKind() { 054 return string("kind"); 055 } 056 057 /** Collects the members of a new {@code PathSegment}. */ 058 public static final class Builder extends SqllrObject.Builder<PathSegment, Builder> { 059 private Builder(Map<String, Object> from) { 060 super(from); 061 } 062 063 /** Sets the member {@code kind}; null removes it. */ 064 public Builder kind(String value) { 065 return set("kind", value); 066 } 067 068 @Override 069 public PathSegment build() { 070 return new PathSegment(frozenMembers()); 071 } 072 } 073}