本文整理汇总了Java中com.neverwinterdp.util.text.StringUtil.toStringArray方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtil.toStringArray方法的具体用法?Java StringUtil.toStringArray怎么用?Java StringUtil.toStringArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.neverwinterdp.util.text.StringUtil
的用法示例。
在下文中一共展示了StringUtil.toStringArray方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: selectClusterMember
import com.neverwinterdp.util.text.StringUtil; //导入方法依赖的package包/类
public ClusterMember selectClusterMember(String connect) {
int port = 5700 ;
String host = connect ;
if(connect.indexOf(':') > 0) {
String[] parts = StringUtil.toStringArray(connect, ":") ;
host = parts[0] ;
port = Integer.parseInt(parts[1]) ;
}
for(Member sel : this.memberMap.values()) {
ClusterMember cmember = new ClusterMemberImpl(sel) ;
if(host.equals(cmember.getHost()) || host.equals(cmember.getIpAddress())) {
if(port == cmember.getPort()) return cmember ;
}
}
return null ;
}
示例2: execute
import com.neverwinterdp.util.text.StringUtil; //导入方法依赖的package包/类
public void execute(Shell shell, ShellContext context, Command command) {
command.mapAll(this);
String[] pair = StringUtil.toStringArray(pairs.get(0), "=");
String name = pair[0];
String valueString = pair[1];
Object value = valueString;
if ("int".equalsIgnoreCase(type)) {
value = Integer.parseInt(valueString);
} else if ("double".equalsIgnoreCase(type)) {
value = Double.parseDouble(valueString);
} else if ("boolean".equalsIgnoreCase(type)) {
value = Boolean.parseBoolean(valueString);
}
context.getVariables().put(name, value);
}
示例3: LeaderId
import com.neverwinterdp.util.text.StringUtil; //导入方法依赖的package包/类
public LeaderId(String path) {
this.path = path ;
int idx = path.lastIndexOf('/') ;
String nodeName = path.substring(idx + 1) ;
String[] parts = StringUtil.toStringArray(nodeName, "-") ;
this.sequence = Long.parseLong(parts[1]) ;
}
示例4: LockId
import com.neverwinterdp.util.text.StringUtil; //导入方法依赖的package包/类
public LockId(String path) {
this.path = path ;
int idx = path.lastIndexOf('/') ;
nodeName = path.substring(idx + 1) ;
String[] parts = StringUtil.toStringArray(nodeName, "-") ;
this.name = parts[0];
this.session = parts[1] ;
this.sequence = Long.parseLong(parts[2]) ;
}
示例5: TrackingPixelRouteHandler
import com.neverwinterdp.util.text.StringUtil; //导入方法依赖的package包/类
public TrackingPixelRouteHandler(Sparkngin sparkngin, Map<String, String> props) {
this.sparkngin = sparkngin ;
String extractHeaders = MapUtil.getString(props,"tracking.site.extract-headers", null) ;
if(extractHeaders != null) {
String[] extractHeader = StringUtil.toStringArray(extractHeaders) ;
headerMatcher = new Pattern[extractHeader.length] ;
for(int i = 0; i < extractHeader.length; i++) {
headerMatcher[i] = Pattern.compile(extractHeader[i], Pattern.CASE_INSENSITIVE) ;
}
}
}
示例6: getStringArray
import com.neverwinterdp.util.text.StringUtil; //导入方法依赖的package包/类
static public String[] getStringArray(Map<String, String> map, String name, String[] defaultValue) {
if(map == null) return defaultValue ;
String val = map.get(name) ;
if(val != null) return StringUtil.toStringArray(val) ;
return defaultValue ;
}
示例7: setRoles
import com.neverwinterdp.util.text.StringUtil; //导入方法依赖的package包/类
@Inject(optional = true)
public void setRoles(@Named("server.roles") String roles) {
this.roles = StringUtil.toStringArray(roles);
}
示例8: setConnects
import com.neverwinterdp.util.text.StringUtil; //导入方法依赖的package包/类
public void setConnects(String connects) {
this.connect = StringUtil.toStringArray(connects) ;
}