Skip to content

Commit

Permalink
Refactor ColumnSegmentBoundInfo (#33764)
Browse files Browse the repository at this point in the history
* Refactor ColumnSegmentBoundInfo

* Refactor ColumnSegmentBoundInfo
  • Loading branch information
terrymanu authored Nov 21, 2024
1 parent 2efaab8 commit 8b83da5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@

package org.apache.shardingsphere.sql.parser.statement.core.segment.generic.bound;

import lombok.RequiredArgsConstructor;
import lombok.Getter;
import org.apache.shardingsphere.sql.parser.statement.core.value.identifier.IdentifierValue;

/**
* Column segment bound info.
*/
@RequiredArgsConstructor
@Getter
public final class ColumnSegmentBoundInfo {

private final IdentifierValue originalDatabase;
Expand All @@ -35,45 +35,13 @@ public final class ColumnSegmentBoundInfo {
private final IdentifierValue originalColumn;

public ColumnSegmentBoundInfo(final IdentifierValue originalColumn) {
originalDatabase = new IdentifierValue("");
originalSchema = new IdentifierValue("");
originalTable = new IdentifierValue("");
this.originalColumn = originalColumn;
this(null, null, null, originalColumn);
}

/**
* Get original database.
*
* @return original database
*/
public IdentifierValue getOriginalDatabase() {
return null == originalDatabase ? new IdentifierValue("") : originalDatabase;
}

/**
* Get original schema.
*
* @return original schema
*/
public IdentifierValue getOriginalSchema() {
return null == originalSchema ? new IdentifierValue("") : originalSchema;
}

/**
* Get original table.
*
* @return original table
*/
public IdentifierValue getOriginalTable() {
return null == originalTable ? new IdentifierValue("") : originalTable;
}

/**
* Get original column.
*
* @return original column
*/
public IdentifierValue getOriginalColumn() {
return null == originalColumn ? new IdentifierValue("") : originalColumn;
public ColumnSegmentBoundInfo(final IdentifierValue originalDatabase, final IdentifierValue originalSchema, final IdentifierValue originalTable, final IdentifierValue originalColumn) {
this.originalDatabase = null == originalDatabase ? new IdentifierValue("") : originalDatabase;
this.originalSchema = null == originalSchema ? new IdentifierValue("") : originalSchema;
this.originalTable = null == originalTable ? new IdentifierValue("") : originalTable;
this.originalColumn = null == originalColumn ? new IdentifierValue("") : originalColumn;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import org.apache.shardingsphere.sql.parser.statement.core.segment.dml.column.ColumnSegment;
import org.apache.shardingsphere.sql.parser.statement.core.segment.dml.expr.ExpressionSegment;

Expand All @@ -31,7 +30,6 @@
*/
@RequiredArgsConstructor
@Getter
@Setter
public final class MatchAgainstExpression implements ExpressionSegment {

private final int startIndex;
Expand Down

0 comments on commit 8b83da5

Please sign in to comment.