java 中的Collection<? extends Object>c是什么意思

 

 

<?extends Object>表示Collection集合中可以存放任意的Object子类
详细情况请看sun 网站

 

示列代码:

 

 

 

public BusinessAuthenticationToken(Object principal, String phone, Integer merchantId,
boolean cxqyStaff, boolean normalMerchantAuth,
Collection<? extends GrantedAuthority> authorities) {
super(authorities);
if (authorities == null || authorities.size() == 0) {
setAuthenticated(false);
} else {
super.setAuthenticated(true);
}
this.principal = principal;
this.phone = phone;
this.cxqyStaff = cxqyStaff;
this.merchantId = merchantId;
this.normalMerchantAuth = normalMerchantAuth;
}
posted @ 2021-03-25 10:55  风骚羊肉串  阅读(153)  评论(0编辑  收藏  举报