本文整理汇总了Java中com.alibaba.dubbo.config.ReferenceConfig.getInterface方法的典型用法代码示例。如果您正苦于以下问题:Java ReferenceConfig.getInterface方法的具体用法?Java ReferenceConfig.getInterface怎么用?Java ReferenceConfig.getInterface使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.alibaba.dubbo.config.ReferenceConfig
的用法示例。
在下文中一共展示了ReferenceConfig.getInterface方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateKey
import com.alibaba.dubbo.config.ReferenceConfig; //导入方法依赖的package包/类
public String generateKey(ReferenceConfig<?> referenceConfig) {
String iName = referenceConfig.getInterface();
if(StringUtils.isBlank(iName)) {
Class<?> clazz = referenceConfig.getInterfaceClass();
iName = clazz.getName();
}
if(StringUtils.isBlank(iName)) {
throw new IllegalArgumentException("No interface info in ReferenceConfig" + referenceConfig);
}
StringBuilder ret = new StringBuilder();
if(! StringUtils.isBlank(referenceConfig.getGroup())) {
ret.append(referenceConfig.getGroup()).append("/");
}
ret.append(iName);
if(! StringUtils.isBlank(referenceConfig.getVersion())) {
ret.append(":").append(referenceConfig.getVersion());
}
return ret.toString();
}
示例2: generateKey
import com.alibaba.dubbo.config.ReferenceConfig; //导入方法依赖的package包/类
public String generateKey(ReferenceConfig<?> referenceConfig) {
String iName = referenceConfig.getInterface();
if (StringUtils.isBlank(iName)) {
Class<?> clazz = referenceConfig.getInterfaceClass();
iName = clazz.getName();
}
if (StringUtils.isBlank(iName)) {
throw new IllegalArgumentException("No interface info in ReferenceConfig" + referenceConfig);
}
StringBuilder ret = new StringBuilder();
if (!StringUtils.isBlank(referenceConfig.getGroup())) {
ret.append(referenceConfig.getGroup()).append("/");
}
ret.append(iName);
if (!StringUtils.isBlank(referenceConfig.getVersion())) {
ret.append(":").append(referenceConfig.getVersion());
}
return ret.toString();
}
示例3: generateKey
import com.alibaba.dubbo.config.ReferenceConfig; //导入方法依赖的package包/类
public String generateKey(ReferenceConfig<?> referenceConfig) {
String iName = referenceConfig.getInterface();
if(StringUtils.isBlank(iName)) {
Class<?> clazz = referenceConfig.getInterfaceClass();//消费者需要服务的接口类
iName = clazz.getName();
}
if(StringUtils.isBlank(iName)) {
throw new IllegalArgumentException("No interface info in ReferenceConfig" + referenceConfig);
}
StringBuilder ret = new StringBuilder();
if(! StringUtils.isBlank(referenceConfig.getGroup())) {
ret.append(referenceConfig.getGroup()).append("/");// 加组名group
}
ret.append(iName);//加interface
if(! StringUtils.isBlank(referenceConfig.getVersion())) {
ret.append(":").append(referenceConfig.getVersion());// 加版本
}
return ret.toString();
}