All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.diirt.datasource.graphene.ArgumentExpressions Maven / Gradle / Ivy

There is a newer version: 3.1.7
Show newest version
/**
 * Copyright (C) 2010-14 diirt developers. See COPYRIGHT.TXT
 * All rights reserved. Use is subject to license terms. See LICENSE.TXT
 */
package org.diirt.datasource.graphene;

import java.util.List;
import org.diirt.datasource.ReadFunction;
import org.diirt.vtype.VString;
import org.diirt.vtype.VStringArray;

/**
 *
 * @author carcassi
 */
public class ArgumentExpressions {
    public static ReadFunctionArgument stringArgument(ReadFunction function, String argumentName) {
        if (function == null) {
            return new ReadFunctionArgument<>();
        } else {
            return new ReadFunctionArgument<>(new VStringToStringReadFunction(new CheckedReadFunction<>(function, argumentName, VString.class)));
        }
    }
    
    public static ReadFunctionArgument> stringArrayArgument(ReadFunction function, String argumentName) {
        if (function == null) {
            return new ReadFunctionArgument<>();
        } else {
            return new ReadFunctionArgument<>(new VStringArrayToListStringReadFunction(new CheckedReadFunction<>(function, argumentName, VStringArray.class)));
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy