本文整理汇总了Java中org.apache.commons.collections4.list.UnmodifiableList.unmodifiableList方法的典型用法代码示例。如果您正苦于以下问题:Java UnmodifiableList.unmodifiableList方法的具体用法?Java UnmodifiableList.unmodifiableList怎么用?Java UnmodifiableList.unmodifiableList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.collections4.list.UnmodifiableList
的用法示例。
在下文中一共展示了UnmodifiableList.unmodifiableList方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: LogMessage
import org.apache.commons.collections4.list.UnmodifiableList; //导入方法依赖的package包/类
private LogMessage(Type type, String message, Object... arguments) {
Validate.notNull(type);
Validate.notNull(message);
Validate.notNull(arguments); // arguments can contain null elements
this.type = type;
this.message = message;
List<String> args = Arrays.stream(arguments) // convert args to strings here on purpose -- objects may not be immutable/serializable
.map(x -> {
if (x == null) {
return NULL_STRING;
} else if (x instanceof Throwable) {
return ExceptionUtils.getStackTrace((Throwable) x);
} else {
return x.toString();
}
})
.collect(Collectors.toList());
this.arguments = (UnmodifiableList<String>) UnmodifiableList.unmodifiableList(args);
}
示例2: MethodAttributes
import org.apache.commons.collections4.list.UnmodifiableList; //导入方法依赖的package包/类
MethodAttributes(
MethodSignature signature,
InstrumentationSettings settings,
List<ContinuationPoint> continuationPoints,
List<SynchronizationPoint> synchPoints,
CoreVariables coreVars,
CacheVariables cacheVars,
StorageContainerVariables storageContainerVars,
StorageVariables localsStorageVars,
StorageVariables stackStorageVars,
LockVariables lockVars) {
Validate.notNull(signature);
Validate.notNull(settings);
Validate.notNull(continuationPoints);
Validate.notNull(synchPoints);
Validate.notNull(coreVars);
Validate.notNull(cacheVars);
Validate.notNull(storageContainerVars);
Validate.notNull(localsStorageVars);
Validate.notNull(stackStorageVars);
Validate.notNull(lockVars);
Validate.noNullElements(continuationPoints);
Validate.noNullElements(synchPoints);
this.signature = signature;
this.settings = settings;
this.continuationPoints =
(UnmodifiableList<ContinuationPoint>) UnmodifiableList.unmodifiableList(new ArrayList<>(continuationPoints));
this.synchPoints =
(UnmodifiableList<SynchronizationPoint>) UnmodifiableList.unmodifiableList(new ArrayList<>(synchPoints));
this.coreVars = coreVars;
this.cacheVars = cacheVars;
this.storageContainerVars = storageContainerVars;
this.localsStorageVars = localsStorageVars;
this.stackStorageVars = stackStorageVars;
this.lockVars = lockVars;
}
示例3: CreateProcessRequest
import org.apache.commons.collections4.list.UnmodifiableList; //导入方法依赖的package包/类
/**
* Constructs a {@link CreateProcessRequest} object.
* @param id of process
* @param responseBus bus to send responses/notifications to for the created process
* @param executable executable to run
* @param parameters parameters to use when running {@code executable}
* @throws NullPointerException if any argument is {@code null}, or contains {@code null}
*/
public CreateProcessRequest(int id, Bus responseBus, String executable, String ... parameters) {
super(id);
Validate.notNull(responseBus);
Validate.notNull(executable);
Validate.notNull(parameters);
Validate.noNullElements(parameters);
this.responseBus = responseBus;
this.executable = executable;
this.parameters = (UnmodifiableList<String>) UnmodifiableList.unmodifiableList(new ArrayList<>(Arrays.asList(parameters)));
}
示例4: subList
import org.apache.commons.collections4.list.UnmodifiableList; //导入方法依赖的package包/类
@Override
public List<K> subList(final int fromIndexInclusive, final int toIndexExclusive) {
return UnmodifiableList.unmodifiableList(super.subList(fromIndexInclusive, toIndexExclusive));
}
示例5: Address
import org.apache.commons.collections4.list.UnmodifiableList; //导入方法依赖的package包/类
private Address(List<String> addressElements) {
this.addressElements = (UnmodifiableList<String>) UnmodifiableList.unmodifiableList(addressElements);
}
示例6: keyList
import org.apache.commons.collections4.list.UnmodifiableList; //导入方法依赖的package包/类
/**
* Gets a view over the keys in the map as a List.
* <p>
* The List will be ordered by object insertion into the map.
* The List is unmodifiable.
*
* @see #keySet()
* @return the unmodifiable list view over the keys
* @since 3.2
*/
public List<K> keyList() {
return UnmodifiableList.unmodifiableList(insertOrder);
}
示例7: asList
import org.apache.commons.collections4.list.UnmodifiableList; //导入方法依赖的package包/类
/**
* Gets an unmodifiable view of the order of the Set.
*
* @return an unmodifiable list view
*/
public List<E> asList() {
return UnmodifiableList.unmodifiableList(setOrder);
}
示例8: getSets
import org.apache.commons.collections4.list.UnmodifiableList; //导入方法依赖的package包/类
/**
* Gets the sets being decorated.
*
* @return Unmodifiable list of all sets in this composite.
*/
public List<Set<E>> getSets() {
return UnmodifiableList.unmodifiableList(all);
}
示例9: unmodifiableList
import org.apache.commons.collections4.list.UnmodifiableList; //导入方法依赖的package包/类
/**
* Returns an unmodifiable list backed by the given list.
* <p>
* This method uses the implementation in the decorators subpackage.
*
* @param <E> the element type
* @param list the list to make unmodifiable, must not be null
* @return an unmodifiable list backed by the given list
* @throws NullPointerException if the list is null
*/
public static <E> List<E> unmodifiableList(final List<? extends E> list) {
return UnmodifiableList.unmodifiableList(list);
}
示例10: getCollections
import org.apache.commons.collections4.list.UnmodifiableList; //导入方法依赖的package包/类
/**
* Gets the collections being decorated.
*
* @return Unmodifiable list of all collections in this composite.
*/
public List<Collection<E>> getCollections() {
return UnmodifiableList.unmodifiableList(all);
}
示例11: getIterators
import org.apache.commons.collections4.list.UnmodifiableList; //导入方法依赖的package包/类
/**
* Gets the list of Iterators (unmodifiable).
*
* @return the unmodifiable list of iterators added
*/
public List<Iterator<? extends E>> getIterators() {
return UnmodifiableList.unmodifiableList(iterators);
}