java.util.Dictionary.remove()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(194)

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

Dictionary.remove介绍

[英]Removes the key/value pair with the specified key from this dictionary.
[中]

代码示例

代码示例来源:origin: spring-projects/spring-roo

@Override
public void removeRepo(String url) throws Exception {
 LOGGER.log(Level.INFO, "Removing repository " + url + "...");
 getRepositoryAdmin().removeRepository(url);
 // Removing repos from installed Repos list
 installedRepos.remove(url);
 // Updating configuration service with installed repos
 config.update(installedRepos);
 LOGGER.log(Level.INFO, "Repository '" + url + "' removed!");
}

代码示例来源:origin: org.apache.karaf.config/org.apache.karaf.config.command

@SuppressWarnings("rawtypes")
  @Override
  public void propertyAction(Dictionary props) {
    props.remove(prop);
  }
}

代码示例来源:origin: org.apache.felix/org.apache.felix.configadmin

static void clearAutoProperties( Dictionary<String, Object> properties )
{
  for(final String p : AUTO_PROPS)
  {
    properties.remove( p );
  }
}

代码示例来源:origin: apache/felix

static void clearAutoProperties( Dictionary<String, Object> properties )
{
  for(final String p : AUTO_PROPS)
  {
    properties.remove( p );
  }
}

代码示例来源:origin: apache/felix

/**
 * @param property
 * @param obj
 */
public void setProperty(String property, Object obj) {
  properties.remove(property);
  properties.put(property, obj);
}

代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.entityhub.yard.solr

public void setImmediateCommit(Boolean state) {
  if (state != null) {
    config.put(IMMEDIATE_COMMIT, state);
  } else {
    config.remove(IMMEDIATE_COMMIT);
  }
}

代码示例来源:origin: org.apache.aries.blueprint/org.apache.aries.blueprint.cm

private static void replaceProperty(Dictionary<String, Object> properties, String key, String value) {
  if (value == null) {
    properties.remove(key);
  } else {
    properties.put(key, value);
  }
}

代码示例来源:origin: org.apache.felix/org.apache.felix.upnp.basedriver

/**
 * @param property
 * @param obj
 */
public void setProperty(String property, Object obj) {
  properties.remove(property);
  properties.put(property, obj);
}

代码示例来源:origin: org.apache.felix/org.apache.felix.configadmin

static protected void replaceProperty( Dictionary<String, Object> properties, String key, String value )
{
  if ( value == null )
  {
    properties.remove( key );
  }
  else
  {
    properties.put( key, value );
  }
}

代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.entityhub.yard.solr

public void setMaxBooleanClauses(Integer integer) {
  if (integer == null || integer.intValue() <= 0) {
    config.remove(MAX_BOOLEAN_CLAUSES);
  } else {
    config.put(MAX_BOOLEAN_CLAUSES, integer);
  }
}

代码示例来源:origin: org.apache.karaf.cave.deployer/org.apache.karaf.cave.deployer.service

@Override
public void deleteConnection(String connection) throws Exception {
  Configuration configuration = configurationAdmin.getConfiguration(CONFIG_PID);
  Dictionary<String, Object> properties = configuration.getProperties();
  if (properties != null) {
    properties.remove(connection + ".jmx");
    properties.remove(connection + ".instance");
    properties.remove(connection + ".username");
    properties.remove(connection + ".password");
    configuration.update(properties);
  }
}

代码示例来源:origin: org.apache.felix/org.apache.felix.configadmin

static void setAutoProperties( Dictionary<String, Object> properties, String pid, String factoryPid )
{
  replaceProperty( properties, Constants.SERVICE_PID, pid );
  replaceProperty( properties, ConfigurationAdmin.SERVICE_FACTORYPID, factoryPid );
  properties.remove( ConfigurationAdmin.SERVICE_BUNDLELOCATION );
  properties.remove( PROPERTY_LOCKED );
  properties.remove( PROPERTY_REVISION );
}

代码示例来源:origin: apache/felix

static void setAutoProperties( Dictionary<String, Object> properties, String pid, String factoryPid )
{
  replaceProperty( properties, Constants.SERVICE_PID, pid );
  replaceProperty( properties, ConfigurationAdmin.SERVICE_FACTORYPID, factoryPid );
  properties.remove( ConfigurationAdmin.SERVICE_BUNDLELOCATION );
  properties.remove( PROPERTY_LOCKED );
  properties.remove( PROPERTY_REVISION );
}

代码示例来源:origin: org.apache.servicemix.kernel.gshell/org.apache.servicemix.kernel.gshell.config

protected void doExecute(ConfigurationAdmin admin) throws Exception {
  Dictionary props = getEditedProps();
  if (props == null) {
    System.err.println("No configuration is being edited. Run the edit command first");
  } else {
    props.remove(prop);
  }
}

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

@Override
  public void on(DbServiceInitialized event) {
    synchronized (asyncInitializers) {
      asyncInitializers.remove(event.source());
      if (asyncInitializers.isEmpty()) {
        daoInitializer.run();
      }
    }
  }
});

代码示例来源:origin: org.actframework/act

@Override
  public void on(DbServiceInitialized event) {
    synchronized (asyncInitializers) {
      asyncInitializers.remove(event.source());
      if (asyncInitializers.isEmpty()) {
        daoInitializer.run();
      }
    }
  }
});

代码示例来源:origin: org.w3c.jigsaw/jigsaw

/**
 * Removes the CacheEntry corresponding to the request.
 */
public synchronized void remove(Request request)
{
System.out.println("**** Removing from cache") ;
CacheEntry ce = (CacheEntry)
  entries.remove(getNormalizedURL(request)) ;
if(ce == null) return ;

lruList.remove(ce) ;
}

代码示例来源:origin: apache/felix

public Dictionary invoke(Dictionary args) throws Exception {
    Long newValue = (Long) args.get(NEW_TIME_VALUE);
    Long oldValue = (Long) ((TimeStateVariable) time).getCurrentValue();
    ((TimeStateVariable) time).setCurrentTime(newValue.longValue());
    ClockDevice.notifier.propertyChange(new PropertyChangeEvent(time,"Time",oldValue,newValue));        
    args.remove(NEW_TIME_VALUE);
    args.put(NEW_RESULT_VALUE,((TimeStateVariable) time).getCurrentTime());
    return args;
  }
}

代码示例来源:origin: org.w3c.jigsaw/jigsaw

public SimpleCacheEntry retrieve(Request request)
{
String url = getNormalizedURL(request) ;
SimpleCacheEntry ce = (SimpleCacheEntry) entries.get(url) ;
if(ce==null) return null ;
if(!ce.isFresh()) {
  lruList.remove(ce) ;
  entries.remove(url) ;
}
lruList.toHead(ce) ;
return ce ;
}

代码示例来源:origin: apache/felix

public void removeCredential(String key, String username) {
  try {
    User user = (User) ac.getUserAdmin().getRole(username);
    user.getCredentials().remove(key);
  } catch (NullPointerException npe) {
    ac.debug("UserAdmin not available. ");
  } catch (Exception e) {
    ac.error("unexpected exception", e);
  }
}

相关文章

微信公众号

最新文章

更多