本文整理了Java中org.restlet.util.Series.subList()
方法的一些代码示例,展示了Series.subList()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Series.subList()
方法的具体详情如下:
包路径:org.restlet.util.Series
类名称:Series
方法名:subList
[英]Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.
[中]返回此列表中指定的fromIndex(包含)和toIndex(独占)之间部分的视图。
代码示例来源:origin: DeviceConnect/DeviceConnect-Android
/**
* Returns a list of all the values associated to the parameter name.
*
* @param name
* The parameter name (case sensitive).
* @return The list of values.
*/
public Series<T> subList(String name) {
return subList(name, false);
}
代码示例来源:origin: org.restlet/org.restlet
/**
* Returns a list of all the values associated to the parameter name.
*
* @param name
* The parameter name (case sensitive).
* @return The list of values.
*/
public Series<E> subList(String name) {
return subList(name, false);
}
代码示例来源:origin: org.restlet.osgi/org.restlet
/**
* Returns a list of all the values associated to the parameter name.
*
* @param name
* The parameter name (case sensitive).
* @return The list of values.
*/
public Series<T> subList(String name) {
return subList(name, false);
}
代码示例来源:origin: org.restlet/org.restlet
/**
* Returns an array of all the values associated to the given parameter
* name.
*
* @param name
* The parameter name to match.
* @param ignoreCase
* Indicates if the name comparison is case sensitive.
* @return The array of values.
*/
public String[] getValuesArray(String name, boolean ignoreCase) {
final List<E> params = subList(name, ignoreCase);
final String[] result = new String[params.size()];
for (int i = 0; i < params.size(); i++) {
result[i] = params.get(i).getValue();
}
return result;
}
代码示例来源:origin: org.restlet.osgi/org.restlet
/**
* Returns an array of all the values associated to the given parameter
* name.
*
* @param name
* The parameter name to match.
* @param ignoreCase
* Indicates if the name comparison is case sensitive.
* @param defaultValue
* The default value to return if no matching parameter found or
* if the parameter has a null value.
* @return The array of values.
*/
public String[] getValuesArray(String name, boolean ignoreCase,
String defaultValue) {
String[] result = null;
List<T> params = subList(name, ignoreCase);
if ((params.size() == 0) && (defaultValue != null)) {
result = new String[1];
result[0] = defaultValue;
} else {
result = new String[params.size()];
for (int i = 0; i < params.size(); i++) {
result[i] = params.get(i).getValue();
}
}
return result;
}
代码示例来源:origin: DeviceConnect/DeviceConnect-Android
/**
* Returns an array of all the values associated to the given parameter
* name.
*
* @param name
* The parameter name to match.
* @param ignoreCase
* Indicates if the name comparison is case sensitive.
* @param defaultValue
* The default value to return if no matching parameter found or
* if the parameter has a null value.
* @return The array of values.
*/
public String[] getValuesArray(String name, boolean ignoreCase,
String defaultValue) {
String[] result = null;
List<T> params = subList(name, ignoreCase);
if ((params.size() == 0) && (defaultValue != null)) {
result = new String[1];
result[0] = defaultValue;
} else {
result = new String[params.size()];
for (int i = 0; i < params.size(); i++) {
result[i] = params.get(i).getValue();
}
}
return result;
}
代码示例来源:origin: org.restlet.osgi/org.restlet
@Override
public List<CacheDirective> getCacheDirectives() {
List<CacheDirective> result = super.getCacheDirectives();
if (!cacheDirectivesAdded) {
for (Header header : getHttpCall().getRequestHeaders().subList(
HeaderConstants.HEADER_CACHE_CONTROL)) {
CacheDirectiveReader.addValues(header, result);
}
cacheDirectivesAdded = true;
}
return result;
}
代码示例来源:origin: org.restlet.jee/org.restlet.ext.jaxrs
/**
* @param params
* @param paramName
* @return
* @throws ConvertQueryParamException
*/
Object getParamValue(final Series<Parameter> params,
final String paramName) throws ConvertParameterException {
Series<Parameter> parameters = params.subList(paramName);
if (this.collType == null) { // no collection parameter
Parameter firstFormParam = params.getFirst(paramName);
String queryParamValue = WrapperUtil.getValue(firstFormParam);
return convertParamValue(queryParamValue);
}
NamedValuesIter queryParamValueIter;
queryParamValueIter = new NamedValuesIter(parameters);
return convertParamValues(queryParamValueIter);
}
}
代码示例来源:origin: org.restlet/org.restlet
} else {
request.getAttributes().put(ei.attribute,
cookies.subList(ei.parameter));
代码示例来源:origin: org.restlet.jee/org.restlet.ext.jaxrs
(Series) cookies.subList(cookieName)));
} catch (ConvertParameterException e) {
throw new ConvertCookieParamException(e);
代码示例来源:origin: org.restlet.osgi/org.restlet
cookies.subList(ei.parameter));
代码示例来源:origin: org.restlet.jee/org.restlet.ext.jaxrs
@Override
public Object getParamValue() {
Series<Header> httpHeaders = Util.getHttpHeaders(this.tlContext
.get().getRequest());
String headerName = this.headerParam.value();
try {
if (this.collType == null) { // no collection parameter
final String firstHeader = WrapperUtil.getValue(httpHeaders
.getFirst(headerName, true));
return convertParamValue(firstHeader);
}
return convertParamValues(new NamedValuesIter(
httpHeaders.subList(headerName, true)));
} catch (ConvertParameterException e) {
throw new ConvertHeaderParamException(e);
}
}
}
代码示例来源:origin: org.restlet.jee/org.restlet.ext.wadl
result.add(parameterInfo.getName(), parameterInfo.getFixed());
} else if (ParameterStyle.HEADER.equals(parameterInfo.getStyle())) {
result = getHeaders().subList(parameterInfo.getName());
} else if (ParameterStyle.TEMPLATE.equals(parameterInfo.getStyle())) {
Object parameter = getRequest().getAttributes().get(
内容来源于网络,如有侵权,请联系作者删除!