Java 类org.apache.commons.collections4.list.UnmodifiableList 实例源码

项目:actors    文件:LogMessage.java   
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);
}
项目:app-runner    文件:SystemInfo.java   
public SystemInfo(String hostName, String user, Long pid, List<String> publicKeys, String osName, int numCpus) {
    this.hostName = hostName;
    this.user = user;
    this.pid = pid;
    this.publicKeys = new UnmodifiableList<>(publicKeys);
    this.osName = osName;
    this.numCpus = numCpus;
}
项目:coroutines    文件:MethodAttributes.java   
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;
}
项目:coroutines    文件:SerializationPostInstrumentationPass.java   
@Override
public void pass(ClassNode classNode, InstrumentationState state) {
    Validate.notNull(classNode);
    Validate.notNull(state);


    // Methods attributes should be assigned at this point.
    Validate.validState(!state.methodAttributes().isEmpty());
    Validate.validState(state.methodAttributes().keySet().stream().allMatch(x -> x != null));
    Validate.validState(state.methodAttributes().values().stream().allMatch(x -> x != null));

    // Sanity check to make sure that we're only dealing with methodnodes in the classnode -- this should never trigger unless previous
    // passes mess up
    Validate.validState(classNode.methods.containsAll(state.methodAttributes().keySet()));


    // Generate the fields needed by the serializer/deserializer
    for (Map.Entry<MethodNode, MethodAttributes> method : state.methodAttributes().entrySet()) {            
        MethodAttributes methodAttrs = method.getValue();

        UnmodifiableList<ContinuationPoint> continuationPoints =  methodAttrs.getContinuationPoints();

        // Shove in versioning info for the method as a fields on the class. 
        int methodId = methodAttrs.getSignature().getMethodId();
        for (int i = 0; i < continuationPoints.size(); i++) {
            int continuationPointId = i;
            FieldNode methodIdField = new FieldNode(
                    INSTRUMENTED_METHODID_FIELD_ACCESS,
                    getIdentifyingFieldName(methodId, continuationPointId),
                    INSTRUMENTED_METHODID_FIELD_TYPE.getDescriptor(),
                    null,
                    INSTRUMENTED_METHODID_FIELD_VALUE);
            classNode.fields.add(methodIdField);
        }
    }
}
项目:portmapper    文件:CreateProcessRequest.java   
/**
 * 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)));
}
项目:actors    文件:MemoryStore.java   
private MemoryStore(String prefix, int concurrency) {
    Validate.notNull(prefix);
    Validate.isTrue(concurrency > 0);

    LockRegion[] regions = new LockRegion[concurrency];
    for (int i = 0; i < regions.length; i++) {
        regions[i] = new LockRegion();
    }

    this.prefix = prefix;
    this.lockRegions = (UnmodifiableList<LockRegion>) unmodifiableList(new ArrayList<>(asList(regions)));
    this.closed = false;
}
项目:actors    文件:Context.java   
BatchedCreateRootCommand(String id, Coroutine coroutine, Object... primingMessages) {
    Validate.notNull(id);
    Validate.notNull(coroutine);
    Validate.notNull(primingMessages);
    Validate.noNullElements(primingMessages);
    this.id = id;
    this.coroutine = coroutine;
    this.primingMessages = (UnmodifiableList<Object>) unmodifiableList(new ArrayList<>(Arrays.asList(primingMessages)));
}
项目:actors    文件:Context.java   
BatchedCreateChildCommand(Context fromContext, String id, Coroutine coroutine, Object... primingMessages) {
    Validate.notNull(fromContext);
    Validate.notNull(id);
    Validate.notNull(coroutine);
    Validate.notNull(primingMessages);
    Validate.noNullElements(primingMessages);
    this.fromContext = fromContext;
    this.id = id;
    this.coroutine = coroutine;
    this.primingMessages = (UnmodifiableList<Object>) unmodifiableList(new ArrayList<>(Arrays.asList(primingMessages)));
}
项目:actors    文件:RequestBlock.java   
RequestBlock(String id, int outQueueOffset, int inQueueOffset, List<Message> inQueue) {
    Validate.notNull(id);
    Validate.notNull(inQueue);
    Validate.noNullElements(inQueue);
    Validate.isTrue(outQueueOffset >= 0);
    Validate.isTrue(inQueueOffset >= 0);

    this.id = id;
    this.outQueueOffset = outQueueOffset;
    this.inQueueOffset = inQueueOffset;
    this.inQueue = (UnmodifiableList<Message>) unmodifiableList(new ArrayList<>(inQueue));
}
项目:HCFCore    文件:LinkedMap.java   
@Override
public List<K> subList(final int fromIndexInclusive, final int toIndexExclusive) {
    return UnmodifiableList.unmodifiableList(super.subList(fromIndexInclusive, toIndexExclusive));
}
项目:HCFCore    文件:LinkedMap.java   
@Override
public List<K> subList(final int fromIndexInclusive, final int toIndexExclusive) {
    return UnmodifiableList.unmodifiableList(super.subList(fromIndexInclusive, toIndexExclusive));
}
项目:metasfresh    文件:HUPackingMaterialDocumentLineCandidate.java   
public List<IHUPackingMaterialCollectorSource> getSources()
{
    return new UnmodifiableList<IHUPackingMaterialCollectorSource>(sources);
}
项目:coroutines    文件:SerializationDetailer.java   
public void detail(MethodNode methodNode, MethodAttributes attrs, StringBuilder output) {
    Validate.notNull(methodNode);
    Validate.notNull(attrs);
    Validate.notNull(output);

    int methodId = attrs.getSignature().getMethodId();

    output.append("Class Name: ").append(attrs.getSignature().getClassName().replace('/', '.')).append('\n');
    output.append("Method Name: ").append(attrs.getSignature().getMethodName()).append('\n');
    output.append("Method Params: ").append(attrs.getSignature().getMethodDescriptor()).append('\n');
    output.append("Method Return: ").append(attrs.getSignature().getReturnType()).append('\n');
    output.append("Method ID: ").append(methodId).append('\n');
    output.append("------------------------------------\n");

    UnmodifiableList<ContinuationPoint> cps = attrs.getContinuationPoints();
    for (int i = 0; i < cps.size(); i++) {
        ContinuationPoint cp = cps.get(i);

        int line = cp.getLineNumber() == null ? -1 : cp.getLineNumber();
        String header = String.format("Continuation Point ID: %-4d Line: %-4d Type: %s",
                i,
                line,
                cp.getClass().getSimpleName());
        output.append(header).append('\n');

        // Check out PackStateGenerators class for how things are organized. Brief overview follows...
        // container[0] has local variables that are bytes/shorts/ints
        // container[1] has local variables that are floats
        // container[2] has local variables that are longs
        // container[3] has local variables that are doubles
        // container[4] has local variables that are Objects
        // container[5] has operands that are bytes/shorts/ints
        // container[6] has operands that are floats
        // container[7] has operands that are longs
        // container[8] has operands that are doubles
        // container[9] has operands that are Objects
        detailLocals(cp, methodNode, output);
        detailOperands(cp, output);

        output.append('\n');
    }

    output.append('\n');
}
项目:coroutines    文件:MethodAttributes.java   
public UnmodifiableList<ContinuationPoint> getContinuationPoints() {
    return continuationPoints;
}
项目:coroutines    文件:MethodAttributes.java   
public UnmodifiableList<SynchronizationPoint> getSynchronizationPoints() {
    return synchPoints;
}
项目:actors    文件:Context.java   
UnmodifiableList<BatchedOutgoingMessageCommand> viewOuts() {
    return (UnmodifiableList<BatchedOutgoingMessageCommand>) unmodifiableList(outs);
}
项目:actors    文件:Context.java   
UnmodifiableList<Object> getPrimingMessages() {
    return primingMessages;
}
项目:actors    文件:Context.java   
UnmodifiableList<Object> getPrimingMessages() {
    return primingMessages;
}
项目:actors    文件:ResponseBlock.java   
ResponseBlock(List<Message> outQueue) {
    Validate.notNull(outQueue);
    Validate.noNullElements(outQueue);
    this.outQueue = (UnmodifiableList<Message>) unmodifiableList(new ArrayList<>(outQueue));
}
项目:actors    文件:ResponseBlock.java   
public UnmodifiableList<Message> getOutQueue() {
    return outQueue;
}
项目:actors    文件:RequestBlock.java   
public UnmodifiableList<Message> getInQueue() {
    return inQueue;
}
项目:actors    文件:Address.java   
private Address(List<String> addressElements) {
    this.addressElements = (UnmodifiableList<String>) UnmodifiableList.unmodifiableList(addressElements);
}
项目:HCFCore    文件:ListOrderedMap.java   
/**
 * 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);
}
项目:HCFCore    文件:ListOrderedSet.java   
/**
 * Gets an unmodifiable view of the order of the Set.
 *
 * @return an unmodifiable list view
 */
public List<E> asList() {
    return UnmodifiableList.unmodifiableList(setOrder);
}
项目:HCFCore    文件:CompositeSet.java   
/**
 * Gets the sets being decorated.
 *
 * @return Unmodifiable list of all sets in this composite.
 */
public List<Set<E>> getSets() {
    return UnmodifiableList.unmodifiableList(all);
}
项目:HCFCore    文件:ListUtils.java   
/**
 * 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);
}
项目:HCFCore    文件:CompositeCollection.java   
/**
 * Gets the collections being decorated.
 *
 * @return Unmodifiable list of all collections in this composite.
 */
public List<Collection<E>> getCollections() {
    return UnmodifiableList.unmodifiableList(all);
}
项目:HCFCore    文件:CollatingIterator.java   
/**
 * Gets the list of Iterators (unmodifiable).
 *
 * @return the unmodifiable list of iterators added
 */
public List<Iterator<? extends E>> getIterators() {
    return UnmodifiableList.unmodifiableList(iterators);
}
项目:HCFCore    文件:ListOrderedMap.java   
/**
 * 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);
}
项目:HCFCore    文件:ListOrderedSet.java   
/**
 * Gets an unmodifiable view of the order of the Set.
 *
 * @return an unmodifiable list view
 */
public List<E> asList() {
    return UnmodifiableList.unmodifiableList(setOrder);
}
项目:HCFCore    文件:CompositeSet.java   
/**
 * Gets the sets being decorated.
 *
 * @return Unmodifiable list of all sets in this composite.
 */
public List<Set<E>> getSets() {
    return UnmodifiableList.unmodifiableList(all);
}
项目:HCFCore    文件:ListUtils.java   
/**
 * 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);
}
项目:HCFCore    文件:CompositeCollection.java   
/**
 * Gets the collections being decorated.
 *
 * @return Unmodifiable list of all collections in this composite.
 */
public List<Collection<E>> getCollections() {
    return UnmodifiableList.unmodifiableList(all);
}
项目:HCFCore    文件:CollatingIterator.java   
/**
 * Gets the list of Iterators (unmodifiable).
 *
 * @return the unmodifiable list of iterators added
 */
public List<Iterator<? extends E>> getIterators() {
    return UnmodifiableList.unmodifiableList(iterators);
}
项目:portmapper    文件:CreateProcessRequest.java   
/**
 * Get parameters to use when running executables.
 * @return parameters
 */
public UnmodifiableList<String> getParameters() {
    return parameters;
}