org.apache.wicket.util.lang.Generics.newHashMap()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(129)

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

Generics.newHashMap介绍

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

代码示例

代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * @see java.io.ObjectOutputStream.PutField#put(java.lang.String, boolean)
 */
@Override
public void put(String name, boolean val)
{
  if (mapBoolean == null)
  {
    mapBoolean = Generics.newHashMap(4);
  }
  mapBoolean.put(name, val ? Boolean.TRUE : Boolean.FALSE);
}

代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * @see java.io.ObjectOutputStream.PutField#put(java.lang.String, java.lang.Object)
 */
@Override
public void put(String name, Object val)
{
  if (mapObject == null)
  {
    mapObject = Generics.newHashMap(4);
  }
  mapObject.put(name, val);
}

代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * @see java.io.ObjectOutputStream.PutField#put(java.lang.String, float)
 */
@Override
public void put(String name, float val)
{
  if (mapFloat == null)
  {
    mapFloat = Generics.newHashMap(4);
  }
  mapFloat.put(name, new Float(val));
}

代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * @see java.io.ObjectOutputStream.PutField#put(java.lang.String, double)
 */
@Override
public void put(String name, double val)
{
  if (mapDouble == null)
  {
    mapDouble = Generics.newHashMap(4);
  }
  mapDouble.put(name, new Double(val));
}

代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * @see java.io.ObjectOutputStream.PutField#put(java.lang.String, short)
 */
@Override
public void put(String name, short val)
{
  if (mapShort == null)
  {
    mapShort = Generics.newHashMap(4);
  }
  mapShort.put(name, new Short(val));
}

代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * @see java.io.ObjectOutputStream.PutField#put(java.lang.String, byte)
 */
@Override
public void put(String name, byte val)
{
  if (mapBytes == null)
  {
    mapBytes = Generics.newHashMap(4);
  }
  mapBytes.put(name, new Byte(val));
}

代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * @see java.io.ObjectOutputStream.PutField#put(java.lang.String, char)
 */
@Override
public void put(String name, char val)
{
  if (mapChar == null)
  {
    mapChar = Generics.newHashMap(4);
  }
  mapChar.put(name, new Character(val));
}

代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * @see java.io.ObjectOutputStream.PutField#put(java.lang.String, int)
 */
@Override
public void put(String name, int val)
{
  if (mapInt == null)
  {
    mapInt = Generics.newHashMap(4);
  }
  mapInt.put(name, new Integer(val));
}

代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * @see java.io.ObjectOutputStream.PutField#put(java.lang.String, long)
 */
@Override
public void put(String name, long val)
{
  if (mapLong == null)
  {
    mapLong = Generics.newHashMap(4);
  }
  mapLong.put(name, new Long(val));
}

代码示例来源:origin: org.apache.wicket/wicket-core

/**
 * Allows to set Request header value any time. They'll be applied (add/modify) on process
 * execution {@link #processRequest(MockHttpServletRequest, IRequestHandler, boolean)}. They are
 * reset immediately after and thus are not re-used for a sequence of requests.
 * <p>
 * Deletion (not replace) of pre-configured header value can be achieved by subclassing
 * {@link #processRequest(MockHttpServletRequest, IRequestHandler, boolean)} and modifying the
 * request header directly.
 *
 * @param key
 * @param value
 */
public final void addRequestHeader(final String key, final String value)
{
  Args.notEmpty(key, "key");
  if (preHeader == null)
  {
    preHeader = Generics.newHashMap();
  }
  preHeader.put(key, value);
}

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

/**
 * Allows to set Request header value any time. They'll be applied (add/modify) on process
 * execution {@link #processRequest(MockHttpServletRequest, IRequestHandler, boolean)}. They are
 * reset immediately after and thus are not re-used for a sequence of requests.
 * <p>
 * Deletion (not replace) of pre-configured header value can be achieved by subclassing
 * {@link #processRequest(MockHttpServletRequest, IRequestHandler, boolean)} and modifying the
 * request header directly.
 *
 * @param key
 * @param value
 */
public final void addRequestHeader(final String key, final String value)
{
  Args.notEmpty(key, "key");
  if (preHeader == null)
  {
    preHeader = Generics.newHashMap();
  }
  preHeader.put(key, value);
}

代码示例来源:origin: org.apache.wicket/wicket-core

final Iterator<IModel<T>> newModels, Iterator<Item<T>> existingItems)
final Map<IModel<T>, Item<T>> modelToItem = Generics.newHashMap();
while (existingItems.hasNext())

代码示例来源:origin: org.apache.wicket/wicket-util

/**
 * Sets a variable that will be used in substitution
 * 
 * @param name
 *            variable name
 * @param value
 *            variable value
 * @return this for chaining
 */
public ConversionException setVariable(final String name, final Object value)
{
  Args.notEmpty(name, "name");
  Args.notNull(value, "value");
  if (vars == null)
  {
    vars = Generics.newHashMap(2);
  }
  vars.put(name, value);
  return this;
}

代码示例来源:origin: org.apache.wicket/wicket-core

final HashMap<String, Component> replacedObjects = Generics.newHashMap();
ObjectOutputStream oos = new ReplaceObjectOutputStream(out, replacedObjects);
oos.writeObject(object);

代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service

final HashMap<String, Component> replacedObjects = Generics.newHashMap();
ObjectOutputStream oos = new ReplaceObjectOutputStream(out, replacedObjects);
oos.writeObject(object);

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

requestCycle.setMetaData(CACHE_KEY, cache = Generics.newHashMap());

代码示例来源:origin: com.googlecode.wicket-jquery-ui/wicket-kendo-ui

@Override
public void renderHead(Component component, IHeaderResponse response)
{
  super.renderHead(component, response);
  Map<String, Object> variables = Generics.newHashMap();
  variables.put("field", AjaxPropertyColumn.this.getField());
  variables.put("imageUrl", RequestCycle.get().urlFor(new ResourceReferenceRequestHandler(AbstractDefaultAjaxBehavior.INDICATOR)));
  variables.put("callbackUrl", this.getCallbackUrl());
  response.render(new JavaScriptPackageHeaderItem(AjaxPropertyColumn.class, variables));
}

代码示例来源:origin: sebfz1/wicket-jquery-ui

@Override
public void renderHead(Component component, IHeaderResponse response)
{
  super.renderHead(component, response);
  Map<String, Object> variables = Generics.newHashMap();
  variables.put("field", AjaxPropertyColumn.this.getField());
  variables.put("imageUrl", RequestCycle.get().urlFor(new ResourceReferenceRequestHandler(AbstractDefaultAjaxBehavior.INDICATOR)));
  variables.put("callbackUrl", this.getCallbackUrl());
  response.render(new JavaScriptPackageHeaderItem(AjaxPropertyColumn.class, variables));
}

代码示例来源:origin: org.apache.wicket/wicket-core

requestCycle.setMetaData(CACHE_KEY, cache = Generics.newHashMap());

代码示例来源:origin: de.alpharogroup/wicket-jetty9-runner

/**
 * New wicket filter context handler.
 *
 * @param applicationClass
 *            the application class
 * @param contextPath
 *            the context path
 * @param webapp
 *            the webapp
 * @param maxInactiveInterval
 *            the max inactive interval
 * @param filterPath
 *            the filter path
 * @return the servlet context handler
 */
public static ServletContextHandler newWicketServletContextHandler(
  final Class<? extends Application> applicationClass, final String contextPath,
  final File webapp, final int maxInactiveInterval, final String filterPath)
{
  final Map<String, String> initParameters = Generics.newHashMap();
  initParameters.put(WicketFilter.FILTER_MAPPING_PARAM, filterPath);
  return newWicketServletContextHandler(
    ServletContextHandlerConfiguration.builder().applicationClass(applicationClass)
      .contextPath(contextPath).webapp(webapp).maxInactiveInterval(maxInactiveInterval)
      .initParameter(WicketFilter.FILTER_MAPPING_PARAM, filterPath).filterPath(filterPath)
      .build());
}

相关文章