shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/route/engine/validator/ShardingStatementValidatorFactory.java
/**
     * New instance of sharding statement validator.
     * 
     * @param sqlStatement SQL statement
     * @param shardingConditions sharding conditions
     * @return instance of sharding statement validator
     */
New instance of sharding statement validator.

@param sqlStatement SQL statement
@param shardingConditions sharding conditions
@return instance of sharding statement validator
New instance of sharding statement validator . @param sqlStatement SQL statement @param shardingConditions sharding conditions @return instance of sharding statement validator
public static Optional<ShardingStatementValidator> newInstance(final SQLStatement sqlStatement, final ShardingConditions shardingConditions) {
        if (sqlStatement instanceof DDLStatement) {
            return getDDLStatementValidator(sqlStatement);
        }
        if (sqlStatement instanceof DMLStatement) {
            return getDMLStatementValidator(sqlStatement, shardingConditions);
        }
        return Optional.empty();
    }
public static Optional < ShardingStatementValidator > newInstance ( final SQLStatement sqlStatement , final ShardingConditions shardingConditions ) { if ( sqlStatement instanceof DDLStatement ) { return getDDLStatementValidator ( sqlStatement ) ; } if ( sqlStatement instanceof DMLStatement ) { return getDMLStatementValidator ( sqlStatement , shardingConditions ) ; } return Optional . empty ( ) ; }
New instance of sharding statement validator.
New instance of sharding statement validator .