/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.shardingsphere.core.optimizer.result;

import com.google.common.base.Optional;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.core.optimizer.result.condition.ShardingConditions;

/**
 * Optimize result.
 *
 * @author panjuan
 */
@RequiredArgsConstructor
public final class OptimizeResult {
    
    private final ShardingConditions shardingConditions;
    
    private final InsertColumnValues insertColumnValues;
    
    public OptimizeResult(final ShardingConditions shardingConditions) {
        this(shardingConditions, null);
    }
    
    public OptimizeResult(final InsertColumnValues insertColumnValues) {
        this(null, insertColumnValues);
    }
    
    /**
     * Get sharding conditions.
     * 
     * @return ShardingConditions optional
     */
    public Optional<ShardingConditions> getShardingConditions() {
        return null == shardingConditions ? Optional.<ShardingConditions>absent() : Optional.of(shardingConditions);
    }
    
    /**
     * Get insert column values.
     * 
     * @return insert column values optional
     */
    public Optional<InsertColumnValues> getInsertColumnValues() {
        return null == insertColumnValues ? Optional.<InsertColumnValues>absent() : Optional.of(insertColumnValues);
    }
}

@@ -894,16 +894,38 @@
 tional;%0A
+import lombok.Getter;%0A
 import l
@@ -955,16 +955,100 @@
 ructor;%0A
+import org.apache.shardingsphere.core.optimizer.result.condition.ShardingCondition;%0A
 import o
@@ -1125,16 +1125,47 @@
 tions;%0A%0A
+import java.util.Collections;%0A%0A
 /**%0A * O
@@ -1268,24 +1268,36 @@
 sult %7B%0A    %0A
+    @Getter%0A
     private 
@@ -1623,163 +1623,42 @@
 is(n
-ull, insertColumnValues);%0A    %7D%0A    %0A    /**%0A     * Get sharding conditions.%0A     * %0A     * @return ShardingConditions optional%0A     */%0A    public Op
+ew ShardingConditions(Collec
 tion
-al
+s.
 %3CSha
@@ -1675,150 +1675,40 @@
 tion
-s%3E getShardingConditions() %7B%0A        return null == shardingConditions ? Optional.%3CShardingConditions%3Eabsent() : Optional.of(shardingCondition
+%3EemptyList()), insertColumnValue
 s);%0A

use ShardingConditions