本文整理汇总了Java中org.apache.commons.collections4.list.UnmodifiableList类的典型用法代码示例。如果您正苦于以下问题:Java UnmodifiableList类的具体用法?Java UnmodifiableList怎么用?Java UnmodifiableList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UnmodifiableList类属于org.apache.commons.collections4.list包,在下文中一共展示了UnmodifiableList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:offbynull,项目名称:actors,代码行数:22,代码来源:LogMessage.java
示例2: SystemInfo
import org.apache.commons.collections4.list.UnmodifiableList; //导入依赖的package包/类
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;
}
开发者ID:danielflower,项目名称:app-runner,代码行数:9,代码来源:SystemInfo.java
示例3: 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;
}
开发者ID:offbynull,项目名称:coroutines,代码行数:38,代码来源:MethodAttributes.java
示例4: pass
import org.apache.commons.collections4.list.UnmodifiableList; //导入依赖的package包/类
@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);
}
}
}
开发者ID:offbynull,项目名称:coroutines,代码行数:37,代码来源:SerializationPostInstrumentationPass.java
示例5: 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)));
}
开发者ID:offbynull,项目名称:portmapper,代码行数:20,代码来源:CreateProcessRequest.java
示例6: MemoryStore
import org.apache.commons.collections4.list.UnmodifiableList; //导入依赖的package包/类
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;
}
开发者ID:offbynull,项目名称:actors,代码行数:14,代码来源:MemoryStore.java
示例7: BatchedCreateRootCommand
import org.apache.commons.collections4.list.UnmodifiableList; //导入依赖的package包/类
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)));
}
开发者ID:offbynull,项目名称:actors,代码行数:10,代码来源:Context.java
示例8: BatchedCreateChildCommand
import org.apache.commons.collections4.list.UnmodifiableList; //导入依赖的package包/类
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)));
}
开发者ID:offbynull,项目名称:actors,代码行数:12,代码来源:Context.java
示例9: RequestBlock
import org.apache.commons.collections4.list.UnmodifiableList; //导入依赖的package包/类
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));
}
开发者ID:offbynull,项目名称:actors,代码行数:13,代码来源:RequestBlock.java
示例10: 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));
}
开发者ID:funkemunky,项目名称:HCFCore,代码行数:5,代码来源:LinkedMap.java
示例11: foo
import org.apache.commons.collections4.list.UnmodifiableList; //导入依赖的package包/类
void foo() {
UnmodifiableList myList = new UnmodifiableList(new ArrayList<>()); // Noncompliant {{Avoid using UnmodifiableList}}
// [email protected]+1
MyList myOtherList = new MyList(); // as MyList extends the UnmodifiableList, we expect an issue here
}
开发者ID:SonarSource,项目名称:sonar-custom-rules-examples,代码行数:6,代码来源:AvoidUnmodifiableList.java
示例12: getSources
import org.apache.commons.collections4.list.UnmodifiableList; //导入依赖的package包/类
public List<IHUPackingMaterialCollectorSource> getSources()
{
return new UnmodifiableList<IHUPackingMaterialCollectorSource>(sources);
}
开发者ID:metasfresh,项目名称:metasfresh,代码行数:5,代码来源:HUPackingMaterialDocumentLineCandidate.java
示例13: detail
import org.apache.commons.collections4.list.UnmodifiableList; //导入依赖的package包/类
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');
}
开发者ID:offbynull,项目名称:coroutines,代码行数:45,代码来源:SerializationDetailer.java
示例14: getContinuationPoints
import org.apache.commons.collections4.list.UnmodifiableList; //导入依赖的package包/类
public UnmodifiableList<ContinuationPoint> getContinuationPoints() {
return continuationPoints;
}
开发者ID:offbynull,项目名称:coroutines,代码行数:4,代码来源:MethodAttributes.java
示例15: getSynchronizationPoints
import org.apache.commons.collections4.list.UnmodifiableList; //导入依赖的package包/类
public UnmodifiableList<SynchronizationPoint> getSynchronizationPoints() {
return synchPoints;
}
开发者ID:offbynull,项目名称:coroutines,代码行数:4,代码来源:MethodAttributes.java
示例16: viewOuts
import org.apache.commons.collections4.list.UnmodifiableList; //导入依赖的package包/类
UnmodifiableList<BatchedOutgoingMessageCommand> viewOuts() {
return (UnmodifiableList<BatchedOutgoingMessageCommand>) unmodifiableList(outs);
}
开发者ID:offbynull,项目名称:actors,代码行数:4,代码来源:Context.java
示例17: getPrimingMessages
import org.apache.commons.collections4.list.UnmodifiableList; //导入依赖的package包/类
UnmodifiableList<Object> getPrimingMessages() {
return primingMessages;
}
开发者ID:offbynull,项目名称:actors,代码行数:4,代码来源:Context.java
示例18: ResponseBlock
import org.apache.commons.collections4.list.UnmodifiableList; //导入依赖的package包/类
ResponseBlock(List<Message> outQueue) {
Validate.notNull(outQueue);
Validate.noNullElements(outQueue);
this.outQueue = (UnmodifiableList<Message>) unmodifiableList(new ArrayList<>(outQueue));
}
开发者ID:offbynull,项目名称:actors,代码行数:6,代码来源:ResponseBlock.java
示例19: getOutQueue
import org.apache.commons.collections4.list.UnmodifiableList; //导入依赖的package包/类
public UnmodifiableList<Message> getOutQueue() {
return outQueue;
}
开发者ID:offbynull,项目名称:actors,代码行数:4,代码来源:ResponseBlock.java
示例20: getInQueue
import org.apache.commons.collections4.list.UnmodifiableList; //导入依赖的package包/类
public UnmodifiableList<Message> getInQueue() {
return inQueue;
}
开发者ID:offbynull,项目名称:actors,代码行数:4,代码来源:RequestBlock.java
注:本文中的org.apache.commons.collections4.list.UnmodifiableList类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论