org.neo4j.kernel.configuration.Config.getValue()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(86)

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

Config.getValue介绍

暂无

代码示例

代码示例来源:origin: neo4j/neo4j

@Deprecated
@Override
public boolean containsKey( String key )
{
  return config.getValue( key ).isPresent();
}

代码示例来源:origin: neo4j/neo4j

@Deprecated
@Override
public Object getProperty( String key )
{
  return config.getValue( key ).orElse( null );
}

代码示例来源:origin: neo4j/neo4j

private <T> List<T> parseMatchers( String configName, Config config, String delimiter, Function<String,T>
    matchFunc )
{
  String fullAccessProcedures = config.getValue( configName ).map( Object::toString ).orElse( "" );
  if ( fullAccessProcedures.isEmpty() )
  {
    return Collections.emptyList();
  }
  else
  {
    return Stream.of( fullAccessProcedures.split( delimiter ) ).map( matchFunc )
        .collect( Collectors.toList() );
  }
}

代码示例来源:origin: neo4j/neo4j

public ProcedureConfig( Config config )
{
  this.defaultValue = config.getValue( PROC_ALLOWED_SETTING_DEFAULT_NAME )
      .map( Object::toString )
      .orElse( "" );
  String allowedRoles = config.getValue( PROC_ALLOWED_SETTING_ROLES ).map( Object::toString )
      .orElse( "" );
  this.matchers = Stream.of( allowedRoles.split( SETTING_DELIMITER ) )
      .map( procToRoleSpec -> procToRoleSpec.split( MAPPING_DELIMITER ) )
      .filter( spec -> spec.length > 1 )
      .map( spec ->
      {
        String[] roles =
            stream( spec[1].split( ROLES_DELIMITER ) ).map( String::trim ).toArray( String[]::new );
        return new ProcMatcher( spec[0].trim(), roles );
      } ).collect( Collectors.toList() );
  this.accessPatterns =
      parseMatchers( GraphDatabaseSettings.procedure_unrestricted.name(), config, PROCEDURE_DELIMITER,
          ProcedureConfig::compilePattern );
  this.whiteList =
      parseMatchers( GraphDatabaseSettings.procedure_whitelist.name(), config, PROCEDURE_DELIMITER,
          ProcedureConfig::compilePattern );
  this.defaultTemporalTimeZone = config.get( GraphDatabaseSettings.db_temporal_timezone );
}

代码示例来源:origin: neo4j-contrib/neo4j-apoc-procedures

public static void initialize(GraphDatabaseAPI db) {
  Static.clear();
  Config neo4jConfig = db.getDependencyResolver().resolveDependency(Config.class);
  Map<String, String> params = neo4jConfig.getRaw();
  apocConfig.clear();
  apocConfig.putAll(Util.subMap(params, PREFIX));
  PARAM_WHITELIST.forEach((k, v) -> {
    Optional<Object> configValue = neo4jConfig.getValue(k);
    if (configValue.isPresent()) {
      apocConfig.put(v, configValue.get().toString());
    }
  });
  config.clear();
  params.forEach((k, v) -> { if (!SKIP.matcher(k).find()) {config.put(k, v);} });
}

代码示例来源:origin: org.neo4j.app/neo4j-server

@Deprecated
@Override
public boolean containsKey( String key )
{
  return config.getValue( key ).isPresent();
}

代码示例来源:origin: org.neo4j.app/neo4j-server

@Deprecated
@Override
public Object getProperty( String key )
{
  return config.getValue( key ).orElse( null );
}

代码示例来源:origin: org.neo4j/neo4j-kernel

private <T> List<T> parseMatchers( String configName, Config config, String delimiter, Function<String,T>
    matchFunc )
{
  String fullAccessProcedures = config.getValue( configName ).map( Object::toString ).orElse( "" );
  if ( fullAccessProcedures.isEmpty() )
  {
    return Collections.emptyList();
  }
  else
  {
    return Stream.of( fullAccessProcedures.split( delimiter ) ).map( matchFunc )
        .collect( Collectors.toList() );
  }
}

代码示例来源:origin: org.neo4j/neo4j-kernel

public ProcedureConfig( Config config )
{
  this.defaultValue = config.getValue( PROC_ALLOWED_SETTING_DEFAULT_NAME )
      .map( Object::toString )
      .orElse( "" );
  String allowedRoles = config.getValue( PROC_ALLOWED_SETTING_ROLES ).map( Object::toString )
      .orElse( "" );
  this.matchers = Stream.of( allowedRoles.split( SETTING_DELIMITER ) )
      .map( procToRoleSpec -> procToRoleSpec.split( MAPPING_DELIMITER ) )
      .filter( spec -> spec.length > 1 )
      .map( spec ->
      {
        String[] roles =
            stream( spec[1].split( ROLES_DELIMITER ) ).map( String::trim ).toArray( String[]::new );
        return new ProcMatcher( spec[0].trim(), roles );
      } ).collect( Collectors.toList() );
  this.accessPatterns =
      parseMatchers( GraphDatabaseSettings.procedure_unrestricted.name(), config, PROCEDURE_DELIMITER,
          ProcedureConfig::compilePattern );
  this.whiteList =
      parseMatchers( GraphDatabaseSettings.procedure_whitelist.name(), config, PROCEDURE_DELIMITER,
          ProcedureConfig::compilePattern );
  this.defaultTemporalTimeZone = config.get( GraphDatabaseSettings.db_temporal_timezone );
}

相关文章