org.jvnet.hk2.component.MultiMap.add()方法的使用及代码示例

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

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

MultiMap.add介绍

[英]Adds one more key-value pair.
[中]再添加一个键值对。

代码示例

代码示例来源:origin: javaee/glassfish

static MultiMap<String, String> split(String value) {
  MultiMap<String, String> result = new MultiMap<String, String>();
  String split[] = value.split(",");
  for (String s : split) {
   String split2[] = s.split("=");
   assert(2 == split2.length);
   result.add(split2[0], split2[1]);
  }
  return result;
 }
}

代码示例来源:origin: javaee/glassfish

private void addXRef(Class type, ConfigModel cm) {
  List<ConfigModel> models = implementorsOf.getOne(type);
  if (models==null) {
    models= new ArrayList<ConfigModel>();
    implementorsOf.add(type, models);
  }
  models.add(cm);
}

代码示例来源:origin: javaee/glassfish

/**
 * Based on the model, parse the annotation mirror and updates the metadata bag by adding
 * discovered values.
 */
public void parse(AnnotationMirror a, MultiMap<String,String> metadataBag) {
  assert a.getAnnotationType().equals(type);
  for (Map.Entry<ExecutableElement, String> e : metadataProperties.entrySet()) {
    Map<? extends ExecutableElement, ? extends AnnotationValue> vals = a.getElementValues();
    AnnotationValue value = vals.get(e.getKey());
    if (value!=null) {
      metadataBag.add(e.getValue(), toString(value));
    } else {
      Collection<ExecutableElement> methods = ElementFilter.methodsIn(a.getAnnotationType().asElement().getEnclosedElements());
      for (ExecutableElement decl : methods) {
        if (e.getKey().equals(decl)) {
          value = decl.getDefaultValue();
          metadataBag.add(e.getValue(), toString(value));
          break;
        }
      }
    }
  }
}

代码示例来源:origin: javaee/hk2

@Override
public AbstractBindingBuilder<T> withMetadata(String key, String value) {
  this.metadata.add(key, value);
  return this;
}

代码示例来源:origin: com.eclipsesource.jaxrs/jersey-all

@Override
public AbstractBindingBuilder<T> withMetadata(String key, String value) {
  this.metadata.add(key, value);
  return this;
}

代码示例来源:origin: com.eclipsesource.jaxrs/jersey-all

@Override
public AbstractBindingBuilder<T> withMetadata(String key, List<String> values) {
  for (String value : values) {
    this.metadata.add(key,value);
  }
  return this;
}

代码示例来源:origin: hstaudacher/osgi-jax-rs-connector

@Override
public AbstractBindingBuilder<T> withMetadata(String key, List<String> values) {
  for (String value : values) {
    this.metadata.add(key,value);
  }
  return this;
}

代码示例来源:origin: hstaudacher/osgi-jax-rs-connector

@Override
public AbstractBindingBuilder<T> withMetadata(String key, String value) {
  this.metadata.add(key, value);
  return this;
}

代码示例来源:origin: pl.allegro.tech.hermes/hermes-consumers

public HermesConsumersBuilder withMessageSenderProvider(String protocol, Function<ServiceLocator, ProtocolMessageSenderProvider> messageSenderProviderSupplier) {
  this.messageSenderProviders.add(protocol, messageSenderProviderSupplier);
  return this;
}

代码示例来源:origin: hstaudacher/osgi-jax-rs-connector

@Override
public AbstractBindingBuilder<T> withMetadata(String key, List<String> values) {
  for (String value : values) {
    this.metadata.add(key,value);
  }
  return this;
}

代码示例来源:origin: org.glassfish.hk2/config

@Override
public void addIndex(Inhabitant<?> managed, String typeName, String name) {
 initConfiguredByCollection();
 configuredBy.add(typeName + (null == name ? "" : (":" + name)), (ConfigByInhabitant) managed);
}

代码示例来源:origin: org.glassfish.hk2/hk2-config

private void addXRef(Class type, ConfigModel cm) {
  List<ConfigModel> models = implementorsOf.getOne(type);
  if (models==null) {
    models= new ArrayList<ConfigModel>();
    implementorsOf.add(type, models);
  }
  models.add(cm);
}

代码示例来源:origin: com.sun.enterprise/auto-depends

protected MultiMap<String, String> populateMetadata() {
  // todo : more work needed to support all metadata entries
  MultiMap<String, String> inhMetadata = new MultiMap<String, String>();
  for (Class<? extends Annotation> annotation : metadata.annotations) {
    inhMetadata.add(InhabitantsFile.QUALIFIER_KEY, annotation.getName());
  }
  return inhMetadata;
}

代码示例来源:origin: com.sun.enterprise/config

@Override
public void add(Inhabitant<?> managed) {
 // TODO: we should ignore these because we don't want any unnamed inhabitants in the habitat
 initConfiguredByCollection();
 configuredBy.add(null, (ConfigByInhabitant) managed);
}

代码示例来源:origin: eclipse-ee4j/glassfish

private void addXRef(Class type, ConfigModel cm) {
  List<ConfigModel> models = implementorsOf.getOne(type);
  if (models==null) {
    models= new ArrayList<ConfigModel>();
    implementorsOf.add(type, models);
  }
  models.add(cm);
}

代码示例来源:origin: org.glassfish.hk2/auto-depends

private static void add(MultiMap<String, String> dest, String key, String val) {
 List<String> vals = dest.get(key);
 if (null == vals || !vals.contains(val)) {
  dest.add(key, val);
 }
}

代码示例来源:origin: com.sun.enterprise/auto-depends

private static void add(MultiMap<String, String> dest, String key, String val) {
 List<String> vals = dest.get(key);
 if (null == vals || !vals.contains(val)) {
  dest.add(key, val);
 }
}

代码示例来源:origin: org.glassfish.main.admingui/console-plugin-service

/**
 *    <p> This method allows a new {@link IntegrationPoint} to be added to
 *        the known {@link IntegrationPoint}s.</p>
 */
public void addIntegrationPoint(IntegrationPoint point, String id) {
// Associate the Provider with this IntegrationPoint so we
// have a way to get the correct classloader
point.setConsoleConfigId(id);
// Add it
pointsByType.add(point.getType(), point);
}

代码示例来源:origin: com.sun.enterprise/auto-depends

/**
 * Adds a new inhabitant.
 * <p/>
 * <p/>
 * See {@link Inhabitants} for typical ways to create {@link Inhabitant}s.
 */
public void add(final Inhabitant<?> i) {
  String name = i.typeName();
  byType.add(name, i);
  notify(i, EventType.INHABITANT_ADDED, null, null);
}

代码示例来源:origin: org.glassfish.hk2/auto-depends

/**
 * Adds a new inhabitant.
 * <p/>
 * <p/>
 * See {@link Inhabitants} for typical ways to create {@link Inhabitant}s.
 */
public void add(final Inhabitant<?> i) {
  String name = i.typeName();
  byType.add(name, i);
  notify(i, EventType.INHABITANT_ADDED, null, null);
}

相关文章