@@ -0,0 +1,2773 @@
+/*%0A * Licensed to the Apache Software Foundation (ASF) under one or more%0A * contributor license agreements.  See the NOTICE file distributed with%0A * this work for additional information regarding copyright ownership.%0A * The ASF licenses this file to You under the Apache License, Version 2.0%0A * (the %22License%22); you may not use this file except in compliance with%0A * the License.  You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.apache.shardingsphere.core.rule;%0A%0Aimport com.google.common.base.Objects;%0Aimport com.google.common.base.Splitter;%0Aimport lombok.Getter;%0Aimport lombok.RequiredArgsConstructor;%0Aimport lombok.ToString;%0Aimport org.apache.shardingsphere.core.exception.ShardingConfigurationException;%0A%0Aimport java.util.List;%0A%0A/**%0A * Column unit node.%0A *%0A * @author panjuan%0A */%0A@RequiredArgsConstructor%0A@Getter%0A@ToString%0Apublic final class ColumnNode %7B%0A    %0A    private static final String DELIMITER = %22.%22;%0A    %0A    private final String tableName;%0A    %0A    private final String columnName;%0A    %0A    /**%0A     * Constructs a column node with well-formatted string.%0A     *%0A     * @param columnNode string of column node. use %7B@code .%7D to split table name and column name.%0A     */%0A    public ColumnNode(final String columnNode) %7B%0A        if (!isValidColumnNode(columnNode)) %7B%0A            throw new ShardingConfigurationException(%22Invalid format for actual column node: '%25s'%22, columnNode);%0A        %7D%0A        List%3CString%3E segments = Splitter.on(DELIMITER).splitToList(columnNode);%0A        tableName = segments.get(0);%0A        columnName = segments.get(1);%0A    %7D%0A    %0A    private static boolean isValidColumnNode(final String columnNodeStr) %7B%0A        return columnNodeStr.contains(DELIMITER) && 2 == Splitter.on(DELIMITER).splitToList(columnNodeStr).size();%0A    %7D%0A    %0A    @Override%0A    public boolean equals(final Object object) %7B%0A        if (this == object) %7B%0A            return true;%0A        %7D%0A        if (null == object %7C%7C getClass() != object.getClass()) %7B%0A            return false;%0A        %7D%0A        ColumnNode columnNode = (ColumnNode) object;%0A        return Objects.equal(this.columnName.toUpperCase(), columnNode.columnName.toUpperCase())%0A            && Objects.equal(this.tableName.toUpperCase(), columnNode.tableName.toUpperCase());%0A    %7D%0A    %0A    @Override%0A    public int hashCode() %7B%0A        return Objects.hashCode(columnName.toUpperCase(), tableName.toUpperCase());%0A    %7D%0A%7D%0A

add ColumnNode