Tabnine Logo
Assert.isTrue
Code IndexAdd Tabnine to your IDE (free)

How to use
isTrue
method
in
org.beangle.commons.lang.Assert

Best Java code snippets using org.beangle.commons.lang.Assert.isTrue (Showing top 5 results out of 315)

origin: org.openurp.base/openurp-base-api4j

private static short convert(String time) {
 int index = time.indexOf(':');
 Assert.isTrue(index == 2 && time.length() == 5, "illegal time,it should with 00:00 format");
 Assert.isTrue((toInt(time.substring(0, index)) < 60 && toInt(time.substring(index + 1, index + 3)) < 60),
   "illegal time " + time + ",it should within 60:60.");
 return (short) toInt(time.substring(0, index) + time.substring(index + 1, index + 3));
}
origin: org.openurp.base/openurp-base-api4j

public static HourMinute newHourMinute(String time) {
 int index = time.indexOf(':');
 Assert.isTrue(index == 2 && time.length() == 5, "illegal time,it should with 00:00 format");
 Assert.isTrue((toInt(time.substring(0, index)) < 60 && toInt(time.substring(index + 1, index + 3)) < 60),
   "illegal time " + time + ",it should within 60:60.");
 return new HourMinute((short) toInt(time.substring(0, index) + time.substring(index + 1, index + 3)));
}
origin: org.beangle.commons/beangle-commons-orm

public long count(Class<?> entityClass, String[] attrs, Object[] values, String countAttr) {
 Assert.isTrue(null != attrs && null != values && attrs.length == values.length);
 String entityName = entityClass.getName();
 StringBuilder hql = new StringBuilder();
 if (Strings.isNotEmpty(countAttr)) {
  hql.append("select count(distinct ").append(countAttr).append(") from ");
 } else {
  hql.append("select count(*) from ");
 }
 hql.append(entityName).append(" as entity where ");
 Map<String, Object> params = CollectUtils.newHashMap();
 for (int i = 0; i < attrs.length; i++) {
  if (Strings.isEmpty(attrs[i])) {
   continue;
  }
  String keyName = Strings.replace(attrs[i], ".", "_");
  Object keyValue = values[i];
  params.put(keyName, keyValue);
  if (keyValue != null && (keyValue.getClass().isArray() || keyValue instanceof Collection<?>)) {
   hql.append("entity.").append(attrs[i]).append(" in (:").append(keyName).append(')');
  } else {
   hql.append("entity.").append(attrs[i]).append(" = :").append(keyName);
  }
  if (i < attrs.length - 1) hql.append(" and ");
 }
 return ((Number) searchHQLQuery(hql.toString(), params).get(0)).longValue();
}
origin: org.beangle.security/beangle-security-ids

public void init() throws Exception {
 Assert.notEmpty(this.casServer, "cas server must be specified.");
 Assert.isTrue(!this.casServer.endsWith("/"), "cas server should not end with /");
 Assert.notEmpty(this.loginUri, "loginUri must be specified. like /login");
 Assert.notEmpty(this.artifactName, "artifact name  must be specified.etc. ticket");
}
origin: org.beangle.ioc/beangle-ioc-spring

/**
 * <p>
 * registerBean.
 * </p>
 *
 * @param def bean definition.
 * @param registry a {@link org.beangle.commons.inject.bind.BindRegistry} object.
 * @return a {@link org.springframework.beans.factory.config.BeanDefinition} object.
 */
protected BeanDefinition registerBean(Definition def, BindRegistry registry) {
 BeanDefinition bd = convert(def);
 if ((def.isAbstract() && def.clazz == null) || FactoryBean.class.isAssignableFrom(def.clazz)) {
  try {
   Class<?> target = def.targetClass;
   if (null == target && def.clazz != null)
    target = ((FactoryBean<?>) def.clazz.newInstance()).getObjectType();
   Assert.isTrue(null != target || def.isAbstract(), "Concrete bean [%1$s] should has class.",
     def.beanName);
   registry.register(target, def.beanName, bd);
   // register concrete factory bean
   if (!def.isAbstract()) registry.register(def.clazz, "&" + def.beanName);
  } catch (Exception e) {
   logger.error("Cannot get Factory's Object Type {}", def.clazz);
  }
 } else {
  registry.register(def.clazz, def.beanName, bd);
 }
 logger.debug("Register definition {} for {}", def.beanName, def.clazz);
 return bd;
}
org.beangle.commons.langAssertisTrue

Popular methods of Assert

  • notNull
  • notEmpty

Popular in Java

  • Updating database using SQL prepared statement
  • startActivity (Activity)
  • getResourceAsStream (ClassLoader)
  • getSystemService (Context)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now