@Override public int executeUpdate(Connection connection, String sql, Object[] args, int[] types, PreparedStatementHandler<Db> handler) throws NestedSQLException { Args.notNull(connection, "connection"); Args.notEmpty(sql,"sql"); Args.notNull(args); Args.notNull(types); Args.assertTrue(args.length == types.length || types.length == 0,"args length must equals to types length"); return doExecuteUpdate(connection, sql, args, types, handler); }
public PropertyChange(T dbObject,String property, Object oldValue, Object newValue) { Args.notNull(dbObject,"dbObject"); Args.notEmpty(property,"property"); Args.assertFalse(Objects.equals(oldValue, newValue), "oldValue must not equals to newValue"); this.dbObject = dbObject; this.property = property; this.oldValue = oldValue; this.newValue = newValue; }
public NamedParamNode(Sql.Scope scope, String name) { super(scope); Args.notEmpty(name); this.name = name; }
public MapWrapper(EntityMapping mapping, Map map) { super(mapping, map); Args.notNull(map,"fields"); this.map = map; }
public void setBasePath(String basePath) { Args.notEmpty(basePath, "basePath"); Args.assertTrue(basePath.startsWith("/"), "The base path must be leading with a slash '/'"); this.basePath = Paths.suffixWithoutSlash(basePath); }
static int advance(Iterator<?> iterator, int numberToAdvance) { Args.notNull(iterator); Args.assertTrue(numberToAdvance >= 0, "numberToAdvance"); int i; for (i = 0; i < numberToAdvance && iterator.hasNext(); i++) { iterator.next(); } return i; }
@ConfigProperty public DefaultSecurityConfig setDefaultRememberMeExpires(int defaultRememberExpires) { Args.assertTrue(defaultRememberExpires > 0, "Expires must be > 0"); this.defaultRememberMeExpires = defaultRememberExpires; return this; }
public IfClause(IfStatement[] ifStatements, ElseStatement elseStatement){ Args.notEmpty(ifStatements); this.ifStatements = ifStatements; this.elseStatement = elseStatement; }
public ConvertibleProperty(Function<String, T> converter, T defaultValue) { Args.notNull(converter, "converter"); this.converter = converter; this.value = defaultValue; }
protected JdkHttpRequest(JdkHttpClient client, String url) { Args.notEmpty(url, "url"); Args.assertTrue(Strings.startsWithIgnoreCase(url, HttpClient.PREFIX_HTTP) || Strings.startsWithIgnoreCase(url, HttpClient.PREFIX_HTTPS), "The url must prefix with http:// or https://"); this.client = client; this.url = url; this.ssl = Strings.startsWithIgnoreCase(url, HttpClient.PREFIX_HTTPS); this.connectTimeout = client.getDefaultConnectTimeout(); this.readTimeout = client.getDefaultReadTimeout(); this.charset = client.getDefaultCharset(); }
public static ReflectEnum of(Class<?> enumType){ Args.notNull(enumType,"enumType"); Args.assertTrue(enumType.isEnum(),"'" + enumType.getName() + "' is not an enum type"); ReflectEnum reflectEnum = cache.get(enumType); if(null == reflectEnum){ reflectEnum = new ReflectEnum(enumType); cache.put(enumType, reflectEnum); } return reflectEnum; }
@Instrument public static <T extends Model> List<T> lastCreated(int num) { Args.assertTrue(num > 0,"num must be > 0"); return (List<T>)query().lastCreated(num).list(); }
public DbIndex(String name,boolean unique,String[] columnNames) { super(name); Args.notEmpty(columnNames,"the column names"); this.unique = unique; this.columnNames = columnNames; }
@Override public int executeUpdate(Connection connection, String sql, Object[] args, int[] types) throws NestedSQLException { Args.notNull(connection, "connection"); Args.notEmpty(sql,"sql"); Args.notNull(args); Args.notNull(types); Args.assertTrue(args.length == types.length || types.length == 0,"args length must equals to types length"); return doExecuteUpdate(connection, sql, args, types, null); }
public IndexDefinitionChange(DbTable table, DbIndex oldIndex, DbIndex newIndex,List<IndexPropertyChange> propertyChanges) { super(table, oldIndex, newIndex); Args.notNull(oldIndex,"oldIndex"); Args.notNull(newIndex,"newIndex"); Args.notEmpty(propertyChanges,"propertyChanges"); this.propertyChanges = propertyChanges; }
public SimpleTokenEncoder(String secret, int expiresInSeconds) { Args.notEmpty(secret,"secret"); this.secret = secret; this.expiresInSeconds = expiresInSeconds; }
public MCollectionType(String summary, String description, MType elementType) { super(summary, description); Args.notNull(elementType); this.elementType = elementType; }