本文整理汇总了Java中org.dmfs.rfc3986.parameters.Parameter类的典型用法代码示例。如果您正苦于以下问题:Java Parameter类的具体用法?Java Parameter怎么用?Java Parameter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Parameter类属于org.dmfs.rfc3986.parameters包,在下文中一共展示了Parameter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: iterator
import org.dmfs.rfc3986.parameters.Parameter; //导入依赖的package包/类
@Override
public Iterator<Parameter> iterator()
{
return new SerialIterator<>(
new FilteredIterator<>(mDelegate.iterator(), new AbstractFilteredIterator.IteratorFilter<Parameter>()
{
@Override
public boolean iterate(Parameter element)
{
// don't iterate keys that we have in mNewParameters
for (Parameter parameter : mNewParameters)
{
// TODO: get rid of the toString conversion and use something like an `Equalable`
// TODO: maybe move this check to ParameterType
if (parameter.name().toString().equals(element.name().toString()))
{
return false;
}
}
return true;
}
}), new ArrayIterator<>(mNewParameters));
}
示例2: iterator
import org.dmfs.rfc3986.parameters.Parameter; //导入依赖的package包/类
@Override
public Iterator<Parameter> iterator()
{
return new FilteredIterator<>(mDelegate.iterator(), new AbstractFilteredIterator.IteratorFilter<Parameter>()
{
@Override
public boolean iterate(Parameter element)
{
// don't iterate keys that we have in mRemovedTypes
for (ParameterType<?> param : mRemovedTypes)
{
// TODO: get rid of the toString conversion and use something like an `Equalable`
// TODO: maybe move this check to ParameterType
if (param.name().toString().equals(element.name().toString()))
{
return false;
}
}
return true;
}
});
}
示例3: parameter
import org.dmfs.rfc3986.parameters.Parameter; //导入依赖的package包/类
@Override
public Parameter parameter(final T value)
{
return new Parameter()
{
@Override
public CharSequence name()
{
return mName;
}
@Override
public CharSequence textValue()
{
return mValueType.serializedValue(value);
}
};
}
示例4: toString
import org.dmfs.rfc3986.parameters.Parameter; //导入依赖的package包/类
@Override
public String toString()
{
if (mText == null)
{
StringBuilder sb = new StringBuilder(256);
boolean first = true;
for (Parameter parameter : mParams)
{
if (first)
{
first = false;
}
else
{
sb.append('&');
}
sb.append(new FormEncoded(parameter.name(), mCharSet));
sb.append('=');
sb.append(new FormEncoded(parameter.textValue(), mCharSet));
}
mText = sb.toString();
}
return mText;
}
示例5: iterator
import org.dmfs.rfc3986.parameters.Parameter; //导入依赖的package包/类
@Override
public Iterator<Parameter> iterator()
{
if (!mDelegate.isPresent() || mDelegate.value().length() == 0)
{
return EmptyIterator.instance();
}
return new ConvertedIterator<>(new Split(mDelegate.value(), '&'), CONVERTER);
}
示例6: OptionalParameter
import org.dmfs.rfc3986.parameters.Parameter; //导入依赖的package包/类
public OptionalParameter(final ParameterType<V> parameterType, final ParameterList delegate)
{
mDelegate = new Iterable<V>()
{
@Override
public Iterator<V> iterator()
{
return new ConvertedIterator<>(
new FilteredIterator<>(
delegate.iterator(),
new AbstractFilteredIterator.IteratorFilter<Parameter>()
{
@Override
public boolean iterate(Parameter element)
{
// TODO: get rid of the toString conversion and use something like an `Equalable`
// TODO: maybe move this check to ParameterType
return element.name().toString().equals(parameterType.name().toString());
}
}),
new AbstractConvertedIterator.Converter<V, Parameter>()
{
@Override
public V convert(Parameter element)
{
return parameterType.value(element);
}
});
}
};
}
示例7: value
import org.dmfs.rfc3986.parameters.Parameter; //导入依赖的package包/类
@Override
public T value(Parameter parameter)
{
if (!name().toString().equals(parameter.name().toString()))
{
throw new IllegalArgumentException(
String.format("Given parameter has wrong type \"%s\". Expected type \"%s\"", parameter.name().toString(), mName.toString()));
}
return mValueType.parsedValue(parameter.textValue());
}
示例8: XWwwFormUrlEncodedEntity
import org.dmfs.rfc3986.parameters.Parameter; //导入依赖的package包/类
public XWwwFormUrlEncodedEntity(Iterable<Pair<CharSequence, CharSequence>> values)
{
this(new BasicParameterList(
new Mapped<>(
values,
new Function<Pair<CharSequence, CharSequence>, Parameter>()
{
@Override
public Parameter apply(final Pair<CharSequence, CharSequence> argument)
{
return new PairParameter(argument);
}
})));
}
示例9: iterator
import org.dmfs.rfc3986.parameters.Parameter; //导入依赖的package包/类
@Override
public Iterator<Parameter> iterator()
{
return EmptyIterator.instance();
}
示例10: alsoWith
import org.dmfs.rfc3986.parameters.Parameter; //导入依赖的package包/类
@Override
public FluentParameterList alsoWith(Parameter... parameters)
{
return new Fluent(new Appending(mDelegate, parameters));
}
示例11: ratherWith
import org.dmfs.rfc3986.parameters.Parameter; //导入依赖的package包/类
@Override
public FluentParameterList ratherWith(Parameter... parameters)
{
return new Fluent(new Replacing(mDelegate, parameters));
}
示例12: iterator
import org.dmfs.rfc3986.parameters.Parameter; //导入依赖的package包/类
@Override
public Iterator<Parameter> iterator()
{
return mDelegate.iterator();
}
示例13: Appending
import org.dmfs.rfc3986.parameters.Parameter; //导入依赖的package包/类
public Appending(ParameterList delegate, Parameter... newParameters)
{
mDelegate = delegate;
mNewParameters = newParameters;
}
示例14: iterator
import org.dmfs.rfc3986.parameters.Parameter; //导入依赖的package包/类
@Override
public Iterator<Parameter> iterator()
{
return new SerialIterator<>(mDelegate.iterator(), new ArrayIterator<>(mNewParameters));
}
示例15: Replacing
import org.dmfs.rfc3986.parameters.Parameter; //导入依赖的package包/类
public Replacing(ParameterList delegate, Parameter... newParameters)
{
mDelegate = delegate;
mNewParameters = newParameters;
}