本文整理汇总了Java中org.apache.wicket.util.lang.Generics类的典型用法代码示例。如果您正苦于以下问题:Java Generics类的具体用法?Java Generics怎么用?Java Generics使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Generics类属于org.apache.wicket.util.lang包,在下文中一共展示了Generics类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: convertToList
import org.apache.wicket.util.lang.Generics; //导入依赖的package包/类
/**
*
* @param throwable
* <p>
* @return
*/
private List<Throwable> convertToList(final Throwable throwable) {
List<Throwable> al = Generics.newArrayList();
Throwable cause = throwable;
al.add(cause);
while ((cause.getCause() != null) && (cause != cause.getCause())) {
cause = cause.getCause();
al.add(cause);
}
return al;
}
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:17,代码来源:ErrorPage.java
示例2: convertToList
import org.apache.wicket.util.lang.Generics; //导入依赖的package包/类
/**
* @param throwable
* @return xxx
*/
private List<Throwable> convertToList(final Throwable throwable) {
List<Throwable> al = Generics.newArrayList();
Throwable cause = throwable;
al.add(cause);
while ((cause.getCause() != null) && (cause != cause.getCause())) {
cause = cause.getCause();
al.add(cause);
}
return al;
}
开发者ID:PkayJava,项目名称:pluggable,代码行数:15,代码来源:ExceptionErrorPage.java
示例3: setConnection
import org.apache.wicket.util.lang.Generics; //导入依赖的package包/类
@Override
public void setConnection(Application application, String sessionId, IKey key, IWebSocketConnection connection)
{
Args.notNull(application, "application");
Args.notNull(sessionId, "sessionId");
Args.notNull(key, "key");
ConcurrentMap<String, ConcurrentMap<IKey, IWebSocketConnection>> connectionsBySession = application.getMetaData(KEY);
if (connectionsBySession == null)
{
synchronized (KEY)
{
connectionsBySession = application.getMetaData(KEY);
if (connectionsBySession == null)
{
connectionsBySession = Generics.newConcurrentHashMap();
application.setMetaData(KEY, connectionsBySession);
}
}
}
ConcurrentMap<IKey, IWebSocketConnection> connectionsByPage = connectionsBySession.get(sessionId);
if (connectionsByPage == null && connection != null)
{
connectionsByPage = connectionsBySession.get(sessionId);
if (connectionsByPage == null)
{
connectionsByPage = Generics.newConcurrentHashMap();
ConcurrentMap<IKey, IWebSocketConnection> old = connectionsBySession.putIfAbsent(sessionId, connectionsByPage);
if (old != null)
{
connectionsByPage = old;
}
}
}
if (connection != null)
{
connectionsByPage.put(key, connection);
}
else if (connectionsByPage != null)
{
connectionsByPage.remove(key);
if (connectionsByPage.isEmpty())
{
connectionsBySession.remove(sessionId);
}
}
}
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:50,代码来源:SimpleWebSocketConnectionRegistry.java
注:本文中的org.apache.wicket.util.lang.Generics类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论