leap.lang.New.hashMap()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(201)

本文整理了Java中leap.lang.New.hashMap()方法的一些代码示例,展示了New.hashMap()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。New.hashMap()方法的具体详情如下:
包路径:leap.lang.New
类名称:New
方法名:hashMap

New.hashMap介绍

[英]Create a new HashMap
[中]创建一个新的HashMap

代码示例

代码示例来源:origin: org.leapframework/leap-core

protected static Map<String,Object> newExprVars(AppConfig config) {
  Map<String, Object> vars = New.hashMap();
  vars.put("config", config);
  vars.put("properties",  config.getProperties());
  return vars;
}

代码示例来源:origin: org.leapframework/leap-oauth2

@Override
public String generateIdToken(AuthzAuthentication authc) {
  return generateIdToken(authc,New.hashMap());
}

代码示例来源:origin: org.leapframework/leap-oauth2-server

@Override
public String generateIdToken(AuthzAuthentication authc) {
  return generateIdToken(authc,New.hashMap());
}

代码示例来源:origin: org.leapframework/leap-orm

@Override
protected void prepareBatchStatement_(SqlContext context, PreparedBatchSqlStatementBuilder stm,Object[] params) throws IOException {
  if(null != funcCondition && !funcCondition.apply(context)) {
    return;
  }
  if(null != exprCondition && !EL.test(exprCondition, null, New.hashMap("sqlContext",context,"params",params))){
    return;
  }
  super.prepareBatchStatement_(context, stm,params);
}

代码示例来源:origin: org.leapframework/leap-oauth2-server

protected boolean deleteAuthorizationCode(String code) {
  if(null == deleteAuthorizationCodeCommand) {
    return dao.delete(AuthzCodeEntity.class, code) > 0;
  }else{
    return dao.executeUpdate(deleteAuthorizationCodeCommand,New.hashMap("code", code)) > 0;
  }
}

代码示例来源:origin: org.leapframework/leap-oauth2

protected boolean deleteAuthorizationCode(String code) {
  if(null == deleteAuthorizationCodeCommand) {
    return dao.delete(AuthzCodeEntity.class, code) > 0;
  }else{
    return dao.executeUpdate(deleteAuthorizationCodeCommand,New.hashMap("code", code)) > 0;
  }
}

代码示例来源:origin: org.leapframework/leap-oauth2

@Override
public void cleanupAuthorizationCodes() {
  int result;
  if(null != cleanupAuthorizationCodesCommand) {
    result = dao.executeUpdate(cleanupAuthorizationCodesCommand, New.hashMap("now", new Date()));
  }else{
    result = dao.createCriteriaQuery(AuthzCodeEntity.class).where("expiration <= :now", new Date()).delete();
  }
  log.info("Cleanup {} expired authorization codes", result);
}

代码示例来源:origin: org.leapframework/leap-oauth2-server

@Override
public void cleanupAuthorizationCodes() {
  int result;
  if(null != cleanupAuthorizationCodesCommand) {
    result = dao.executeUpdate(cleanupAuthorizationCodesCommand, New.hashMap("now", new Date()));
  }else{
    result = dao.createCriteriaQuery(AuthzCodeEntity.class).where("expiration <= :now", new Date()).delete();
  }
  log.info("Cleanup {} expired authorization codes", result);
}

代码示例来源:origin: org.leapframework/leap-core

protected Function<Map<String,String>, Boolean> createIfFunction(XmlReader reader) {
  String expr = reader.getRequiredAttribute(EXPR_ATTRIBUTE);
  Expression expression = SPEL.createExpression(parseContext, expr);
  return (props) -> {
    Map<String,Object> vars = New.hashMap("properties", props);
    return EL.test(expression.getValue(vars), true);
  };
}

代码示例来源:origin: org.leapframework/leap-oauth2-server

protected void cleanupSessions(Date now) {
  int result;
  if(null != cleanupSessionsCommand) {
    result = dao.executeUpdate(cleanupSessionsCommand, New.hashMap("now",now));
  }else{
    result = dao.createCriteriaQuery(AuthzSSOSessionEntity.class).where("expiration <= :now",now).delete();
  }
  log.info("Cleanup {} expired sso sessions", result);
}

代码示例来源:origin: org.leapframework/leap-oauth2-server

protected void cleanupRefreshTokens(Date now) {
  int result;
  if(null != cleanupRefreshTokensCommand) {
    result = dao.executeUpdate(cleanupRefreshTokensCommand, New.hashMap("now",now));
  }else{
    result = dao.createCriteriaQuery(AuthzRefreshTokenEntity.class).where("expiration <= :now",now).delete();
  }
  log.info("Cleanup {} expired refresh tokens", result);
}

代码示例来源:origin: org.leapframework/leap-oauth2

protected void cleanupSessions(Date now) {
  int result;
  if(null != cleanupSessionsCommand) {
    result = dao.executeUpdate(cleanupSessionsCommand, New.hashMap("now",now));
  }else{
    result = dao.createCriteriaQuery(AuthzSSOSessionEntity.class).where("expiration <= :now",now).delete();
  }
  log.info("Cleanup {} expired sso sessions", result);
}

代码示例来源:origin: org.leapframework/leap-oauth2-server

protected void cleanupAccessTokens(Date now) {
  int result;
  if(null != cleanupAccessTokensCommand) {
    result = dao.executeUpdate(cleanupAccessTokensCommand, New.hashMap("now",now));
  }else{
    result = dao.createCriteriaQuery(AuthzAccessTokenEntity.class).where("expiration <= :now",now).delete();
  }
  log.info("Cleanup {} expired access tokens", result);
}

代码示例来源:origin: org.leapframework/leap-oauth2

protected void cleanupLogins(Date now) {
  int result;
  if(null != cleanupLoginsCommand) {
    result = dao.executeUpdate(cleanupLoginsCommand, New.hashMap("now",now));
  }else{
    result = dao.createCriteriaQuery(AuthzSSOLoginEntity.class).where("expiration <= :now",now).delete();
  }
  log.info("Cleanup {} expired sso logins", result);
}

代码示例来源:origin: org.leapframework/leap-oauth2

protected void cleanupAccessTokens(Date now) {
  int result;
  if(null != cleanupAccessTokensCommand) {
    result = dao.executeUpdate(cleanupAccessTokensCommand, New.hashMap("now",now));
  }else{
    result = dao.createCriteriaQuery(AuthzAccessTokenEntity.class).where("expiration <= :now",now).delete();
  }
  log.info("Cleanup {} expired access tokens", result);
}

代码示例来源:origin: org.leapframework/leap-oauth2-server

protected void cleanupLogins(Date now) {
  int result;
  if(null != cleanupLoginsCommand) {
    result = dao.executeUpdate(cleanupLoginsCommand, New.hashMap("now",now));
  }else{
    result = dao.createCriteriaQuery(AuthzSSOLoginEntity.class).where("expiration <= :now",now).delete();
  }
  log.info("Cleanup {} expired sso logins", result);
}

代码示例来源:origin: org.leapframework/leap-oauth2

protected void cleanupRefreshTokens(Date now) {
  int result;
  if(null != cleanupRefreshTokensCommand) {
    result = dao.executeUpdate(cleanupRefreshTokensCommand, New.hashMap("now",now));
  }else{
    result = dao.createCriteriaQuery(AuthzRefreshTokenEntity.class).where("expiration <= :now",now).delete();
  }
  log.info("Cleanup {} expired refresh tokens", result);
}

代码示例来源:origin: org.leapframework/leap-webapi

public QueryListResult queryListByRelation(Object relatedId, QueryOptions options) {
  CriteriaQuery<Record> query =
      createCriteriaQuery().joinById(rm.getTargetEntityName(), rm.getName(), "j", relatedId);
  Map<String, ModelAndMapping> joinedModels = New.hashMap("j", new ModelAndMapping(am, em));
  return doQueryListResult(query, joinedModels, options, null, null);
}

代码示例来源:origin: org.leapframework/leap-core

private boolean testIfElement(AppConfigContext context, XmlReader reader) {
    String expressionText = reader.getRequiredAttribute(EXPR_ATTRIBUTE);
    try {
      Expression expression = SPEL.createExpression(parseContext,expressionText);
      Map<String,Object> vars = New.hashMap("properties", context.getProperties());

      return EL.test(expression.getValue(vars), true);
    } catch (Exception e) {
      throw new AppConfigException("Error testing if expression '" + expressionText + "' at " + reader.getCurrentLocation(), e);
    }
  }
}

代码示例来源:origin: org.leapframework/leap-webapi

public Record queryOneByRelation(Object relatedId, QueryOptionsBase options) {
  CriteriaQuery<Record> query =
      createCriteriaQuery().joinById(rm.getTargetEntityName(), rm.getName(), "j", relatedId);
  Map<String, ModelAndMapping> joinedModels = New.hashMap("j", new ModelAndMapping(am, em));
  applySelect(query, options, joinedModels);
  Record record = query.firstOrNull();
  expandOne(record, options);
  return record;
}

相关文章