当前位置: 首页>>代码示例>>Java>>正文


Java Collections.unmodifiableCollection方法代码示例

本文整理汇总了Java中java.util.Collections.unmodifiableCollection方法的典型用法代码示例。如果您正苦于以下问题:Java Collections.unmodifiableCollection方法的具体用法?Java Collections.unmodifiableCollection怎么用?Java Collections.unmodifiableCollection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.util.Collections的用法示例。


在下文中一共展示了Collections.unmodifiableCollection方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTransactions

import java.util.Collections; //导入方法依赖的package包/类
@ApiModelProperty(
        access = "public",
        name = "transactions",
        value = "the transactions that have taken place for the account.")
public Collection<TransactionRepresentation> getTransactions() {
    if (transactions == null) {
        return null;
    } else {
        return Collections.unmodifiableCollection(transactions);
    }
}
 
开发者ID:psd2-in-a-box,项目名称:mid-tier,代码行数:12,代码来源:AccountRepresentation.java

示例2: listNetworkInterfaceIPConfigurations

import java.util.Collections; //导入方法依赖的package包/类
@Override
public Collection<NicIPConfiguration> listNetworkInterfaceIPConfigurations() {
    Collection<NicIPConfiguration> ipConfigs = new ArrayList<>();
    Map<String, NetworkInterface> nics = new TreeMap<>();
    List<IPConfigurationInner> ipConfigRefs = this.inner().ipConfigurations();
    if (ipConfigRefs == null) {
        return ipConfigs;
    }

    for (IPConfigurationInner ipConfigRef : ipConfigRefs) {
        String nicID = ResourceUtils.parentResourceIdFromResourceId(ipConfigRef.id());
        String ipConfigName = ResourceUtils.nameFromResourceId(ipConfigRef.id());
        // Check if NIC already cached
        NetworkInterface nic = nics.get(nicID.toLowerCase());
        if (nic == null) {
            //  NIC not previously found, so ask Azure for it
            nic = this.parent().manager().networkInterfaces().getById(nicID);
        }

        if (nic == null) {
            // NIC doesn't exist so ignore this bad reference
            continue;
        }

        // Cache the NIC
        nics.put(nic.id().toLowerCase(), nic);

        // Get the IP config
        NicIPConfiguration ipConfig = nic.ipConfigurations().get(ipConfigName);
        if (ipConfig == null) {
            // IP config not found, so ignore this bad reference
            continue;
        }

        ipConfigs.add(ipConfig);
    }

    return Collections.unmodifiableCollection(ipConfigs);
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:40,代码来源:SubnetImpl.java

示例3: getCurrentSourceRootsForClasspath

import java.util.Collections; //导入方法依赖的package包/类
/**
 * Finds source roots corresponding to the apparently active classpath
 * (as reported by logging from Ant when it runs the Java launcher with -cp).
 */
private static Collection<FileObject> getCurrentSourceRootsForClasspath(SessionData data) {
    if (data.classpath == null &&
            data.modulepath == null &&
            data.upgradeModulepath == null) {
        return Collections.emptySet();
    }
    Collection<FileObject> result;
    synchronized (data) {
        result = data.searchSourceRoots;
    }
    if (result == null) {
        result = new LinkedHashSet<>();
        addPath(data.classpath, result, false);
        addPath(data.modulepath, result, true);
        addPath(data.upgradeModulepath, result, true);
        if (data.platformSources != null) {
            result.addAll(Arrays.asList(data.platformSources.getRoots()));
        } else {
            // no platform found. use default one:
            JavaPlatform plat = JavaPlatform.getDefault();
            // in unit tests the default platform may be null:
            if (plat != null) {
                result.addAll(Arrays.asList(plat.getSourceFolders().getRoots()));
            }
        }
        result = Collections.unmodifiableCollection(result);
        synchronized (data) {
            data.searchSourceRoots = result;
        }
    }
    return result;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:37,代码来源:JavaAntLogger.java

示例4: jsonNodeToAllocationPools

import java.util.Collections; //导入方法依赖的package包/类
/**
 * Changes JsonNode alocPools to a collection of the alocPools.
 *
 * @param allocationPools the allocationPools JsonNode
 * @return a collection of allocationPools
 */
public Iterable<AllocationPool> jsonNodeToAllocationPools(JsonNode allocationPools) {
    checkNotNull(allocationPools, JSON_NOT_NULL);
    ConcurrentMap<Integer, AllocationPool> alocplMaps = Maps
            .newConcurrentMap();
    Integer i = 0;
    for (JsonNode node : allocationPools) {
        IpAddress startIp = IpAddress.valueOf(node.get("start").asText());
        IpAddress endIp = IpAddress.valueOf(node.get("end").asText());
        AllocationPool alocPls = new DefaultAllocationPool(startIp, endIp);
        alocplMaps.putIfAbsent(i, alocPls);
        i++;
    }
    return Collections.unmodifiableCollection(alocplMaps.values());
}
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:SubnetWebResource.java

示例5: getMethodNames

import java.util.Collections; //导入方法依赖的package包/类
@Override
@NonNull
public Collection<? extends String> getMethodNames(
        final @NonNull String clz,
        final boolean rt,
        final @NullAllowed String returnType,
        final @NullAllowed String... parameterTypes) throws QueryException {
    final List<? extends ExecutableElement> methods = getMethods(clz, null, rt, returnType, parameterTypes);
    final List<String> result = new ArrayList<String>(methods.size());
    for (ExecutableElement method : methods) {
        result.add(method.getSimpleName().toString());
    }
    return Collections.unmodifiableCollection(result);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:JavaOperationsImpl.java

示例6: getSubnets

import java.util.Collections; //导入方法依赖的package包/类
@Override
public Iterable<Subnet> getSubnets() {
    return Collections.unmodifiableCollection(subnetStore.values());
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:SubnetManager.java

示例7: getPropertyKeys

import java.util.Collections; //导入方法依赖的package包/类
public Collection<String> getPropertyKeys() {
	return Collections.unmodifiableCollection(properties.keySet());
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:4,代码来源:Run.java

示例8: getTextBound

import java.util.Collections; //导入方法依赖的package包/类
public Collection<TextBound> getTextBound() {
	return Collections.unmodifiableCollection(textBound);
}
 
开发者ID:Bibliome,项目名称:bibliome-java-utils,代码行数:4,代码来源:AlvisAEAnnotationSet.java

示例9: getProperties

import java.util.Collections; //导入方法依赖的package包/类
public synchronized Collection<Property> getProperties() {
    Property[] properties = getSheet().get(Sheet.PROPERTIES).getProperties();
    return Collections.unmodifiableCollection(Arrays.asList(properties));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:BaseNode.java

示例10: getAnnotationSchemas

import java.util.Collections; //导入方法依赖的package包/类
public Collection<AnnotationSchema> getAnnotationSchemas() {
	return Collections.unmodifiableCollection(annotationSchemas.values());
}
 
开发者ID:Bibliome,项目名称:bibliome-java-utils,代码行数:4,代码来源:DocumentSchema.java

示例11: getViolations

import java.util.Collections; //导入方法依赖的package包/类
Collection<Violation> getViolations() {
    return Collections.unmodifiableCollection(violations);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:ProfileSupport.java

示例12: getFloatingIps

import java.util.Collections; //导入方法依赖的package包/类
@Override
public Collection<FloatingIp> getFloatingIps() {
    return Collections.unmodifiableCollection(floatingIpStore.values());
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:FloatingIpManager.java

示例13: removeMessages

import java.util.Collections; //导入方法依赖的package包/类
public Collection removeMessages() {
    Collection result = Collections.unmodifiableCollection(messages);
    messages.clear();
    return result;
}
 
开发者ID:yunhaibin,项目名称:dubbox-hystrix,代码行数:6,代码来源:MultiMessage.java

示例14: getSnakes

import java.util.Collections; //导入方法依赖的package包/类
protected static Collection<Snake> getSnakes() {
    return Collections.unmodifiableCollection(snakes.values());
}
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:4,代码来源:SnakeTimer.java

示例15: getConsumers

import java.util.Collections; //导入方法依赖的package包/类
public final Collection<Consumer<U>> getConsumers() {
    return (Collections.unmodifiableCollection(this.consumers));
}
 
开发者ID:s-store,项目名称:s-store,代码行数:4,代码来源:Producer.java


注:本文中的java.util.Collections.unmodifiableCollection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。