/*
 * Copyright (c) 2013-2017 Cinchapi Inc.
 *
 * Licensed 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 com.cinchapi.concourse.importer;

import java.util.List;

import com.cinchapi.concourse.util.KeyValue;
import com.google.common.base.Preconditions;

/**
 * A {@link Transformer} that is composed of other {@link Transformer
 * Transformers}.
 * <p>
 * Each of the composing Transformers is applied in declaration order.
 * </p>
 * 
 * @author Jeff Nelson
 */
class CompositeTransformer implements Transformer {

    /**
     * An ordered list of the {@link Transformer transformers} that are applied
     * in the composite {@link #transform(String, String)} method
     */
    private final List<Transformer> transformers;

    /**
     * Construct a new instance.
     * 
     * @param transformers
     */
    public CompositeTransformer(List<Transformer> transformers) {
        Preconditions.checkArgument(!transformers.isEmpty());
        this.transformers = transformers;
    }

    @Override
    public KeyValue<String, Object> transform(String key, String value) {
        KeyValue<String, Object> transformed = null;
        for (Transformer transformer : transformers) {
            transformed = transformer.transform(key, value);
            key = transformed.getKey();
            value = transformed.getValue().toString();
        }
        return transformed;
    }

}

@@ -661,16 +661,51 @@
 .List;%0A%0A
+import javax.annotation.Nullable;%0A%0A
 import c
@@ -1537,16 +1537,30 @@
 verride%0A
+    @Nullable%0A
     publ
@@ -1794,16 +1794,58 @@
 value);%0A
+            if(transformed != null) %7B%0A    
         
@@ -1888,16 +1888,20 @@
         
+   
+ 
 value = 
@@ -1931,24 +1931,38 @@
 toString();%0A
+            %7D%0A
         %7D%0A  

add null safety to Transformers class