com.github.chengyuxing.sql.Args Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rabbit-sql Show documentation
Show all versions of rabbit-sql Show documentation
Light wrapper of JDBC, support ddl, dml, query, plsql/procedure/function, transaction and manage sql
file.
package com.github.chengyuxing.sql;
import com.github.chengyuxing.common.MapExtends;
import com.github.chengyuxing.common.utils.ObjectUtil;
import com.github.chengyuxing.sql.utils.EntityUtil;
import org.jetbrains.annotations.NotNull;
import java.util.HashMap;
import java.util.Map;
/**
* Simple sql args tool.
*
* @param value type
*/
public final class Args extends HashMap implements MapExtends, V> {
/**
* Constructs a new empty Args.
*/
public Args() {
}
public Args(int initialCapacity) {
super(initialCapacity);
}
/**
* Returns an empty Args.
*
* @param value type
* @return empty Args instance
*/
public static Args of() {
return new Args<>();
}
/**
* Returns an Args with generic initial value.
*
* @param k key
* @param v value
* @param value type
* @return generic Args instance
*/
public static Args of(String k, V v) {
Args args = of();
args.put(k, v);
return args;
}
/**
* Returns an Args from more than one pairs of value.
*
* @param input key-value pairs: k v, k v, ...
* @return Args instance
*/
public static Args