public static SchemaPath create(NamePart namePart) { Preconditions.checkArgument(namePart.getType() == NamePart.Type.NAME); return new SchemaPath((NameSegment) getPathSegment(namePart)); }
public Builder mergeFrom(com.dremio.exec.proto.UserBitShared.NamePart other) { if (other == com.dremio.exec.proto.UserBitShared.NamePart.getDefaultInstance()) return this; if (other.hasType()) { setType(other.getType()); } if (other.hasName()) { bitField0_ |= 0x00000002; name_ = other.name_; onChanged(); } if (other.hasChild()) { mergeChild(other.getChild()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public void writeTo(io.protostuff.Output output, com.dremio.exec.proto.UserBitShared.NamePart message) throws java.io.IOException { if(message.hasType()) output.writeEnum(1, message.getType().getNumber(), false); if(message.hasName()) output.writeString(2, message.getName(), false); if(message.hasChild()) output.writeObject(3, message.getChild(), com.dremio.exec.proto.SchemaUserBitShared.NamePart.WRITE, false); } public boolean isInitialized(com.dremio.exec.proto.UserBitShared.NamePart message)
private static PathSegment getPathSegment(NamePart n) { PathSegment child = n.hasChild() ? getPathSegment(n.getChild()) : null; if (n.getType() == Type.ARRAY) { return new ArraySegment(child); } else { return new NameSegment(n.getName(), child); } }