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


Java ImmutableSet.copyOf方法代码示例

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


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

示例1: PropertyEnum

import com.google.common.collect.ImmutableSet; //导入方法依赖的package包/类
protected PropertyEnum(String name, Class<T> valueClass, Collection<T> allowedValues)
{
    super(name, valueClass);
    this.allowedValues = ImmutableSet.copyOf(allowedValues);

    for (T t : allowedValues)
    {
        String s = ((IStringSerializable)t).getName();

        if (this.nameToValue.containsKey(s))
        {
            throw new IllegalArgumentException("Multiple values have the same name \'" + s + "\'");
        }

        this.nameToValue.put(s, t);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:18,代码来源:PropertyEnum.java

示例2: validate

import com.google.common.collect.ImmutableSet; //导入方法依赖的package包/类
@Override
public void validate()
{
	if( checkDuplication || forceUnique )
	{
		final Set<String> values = new HashSet<String>();
		for( NameValue nv : namesValues )
		{
			// nv.value is URL encoded, but the name is ok to use
			values.add(nv.getName());
		}
		final ImmutableCollection<String> valuesReadonly = ImmutableSet.copyOf(values);

		// We need to inform the wizard to check for uniqueness every time,
		// no matter what
		final boolean isUnique = getRepository().checkDataUniqueness(getFirstTarget().getXoqlPath(),
			valuesReadonly, !forceUnique);

		setInvalid(forceUnique && !isUnique && !isInvalid(),
			new KeyLabel("wizard.controls.editbox.uniqueerror")); //$NON-NLS-1$
	}
}
 
开发者ID:equella,项目名称:Equella,代码行数:23,代码来源:CShuffleList.java

示例3: PropertyInteger

import com.google.common.collect.ImmutableSet; //导入方法依赖的package包/类
protected PropertyInteger(String name, int min, int max)
{
    super(name, Integer.class);

    if (min < 0)
    {
        throw new IllegalArgumentException("Min value of " + name + " must be 0 or greater");
    }
    else if (max <= min)
    {
        throw new IllegalArgumentException("Max value of " + name + " must be greater than min (" + min + ")");
    }
    else
    {
        Set<Integer> set = Sets.<Integer>newHashSet();

        for (int i = min; i <= max; ++i)
        {
            set.add(Integer.valueOf(i));
        }

        this.allowedValues = ImmutableSet.copyOf(set);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:25,代码来源:PropertyInteger.java

示例4: OpticalPathIntent

import com.google.common.collect.ImmutableSet; //导入方法依赖的package包/类
private OpticalPathIntent(ApplicationId appId,
                          Key key,
                          ConnectPoint src,
                          ConnectPoint dst,
                          Path path,
                          OchSignal lambda,
                          OchSignalType signalType,
                          boolean isBidirectional,
                          int priority) {
    super(appId, key, ImmutableSet.copyOf(path.links()), priority);
    this.src = checkNotNull(src);
    this.dst = checkNotNull(dst);
    this.path = checkNotNull(path);
    this.lambda = checkNotNull(lambda);
    this.signalType = checkNotNull(signalType);
    this.isBidirectional = isBidirectional;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:18,代码来源:OpticalPathIntent.java

示例5: DefaultVariantsMetaData

import com.google.common.collect.ImmutableSet; //导入方法依赖的package包/类
private DefaultVariantsMetaData(Map<String, Object> variantCoordinates, Map<String, ModelType<?>> variantAxisTypes) {
    this.variantCoordinates = variantCoordinates;
    this.allVariantAxes = variantCoordinates.keySet();
    this.nonNullVariantAxes = ImmutableSet.copyOf(Maps.filterEntries(variantCoordinates, new Predicate<Map.Entry<String, Object>>() {
        @Override
        public boolean apply(Map.Entry<String, Object> input) {
            return input.getValue()!=null;
        }
    }).keySet());
    this.variantAxisTypes = variantAxisTypes;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:12,代码来源:DefaultVariantsMetaData.java

示例6: visit

import com.google.common.collect.ImmutableSet; //导入方法依赖的package包/类
@Override
public RelNode visit(LogicalFilter filter) {
  final RelNode input = filter.getInput().accept(this);
  return new LogicalFilter(
    cluster,
    copyOf(filter.getTraitSet()),
    input,
    copyOf(filter.getCondition()),
    ImmutableSet.copyOf(filter.getVariablesSet())
  );
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:12,代码来源:CopyWithCluster.java

示例7: CreateProjectRequest

import com.google.common.collect.ImmutableSet; //导入方法依赖的package包/类
@JsonCreator
public CreateProjectRequest(@JsonProperty("name") String name,
                            @JsonProperty("owners") @Nullable Set<String> owners,
                            @JsonProperty("members") @Nullable Set<String> members) {
    this.name = validateProjectName(name, "name");
    this.owners = owners != null ? ImmutableSet.copyOf(owners) : ImmutableSet.of();
    this.members = members != null ? ImmutableSet.copyOf(members) : ImmutableSet.of();
}
 
开发者ID:line,项目名称:centraldogma,代码行数:9,代码来源:CreateProjectRequest.java

示例8: unsupportedIdpsForATransaction

import com.google.common.collect.ImmutableSet; //导入方法依赖的package包/类
private List<IdentityProviderConfigEntityData> unsupportedIdpsForATransaction(Set<IdentityProviderConfigEntityData> identityProviderConfigEntityData, TransactionConfigEntityData transactionConfigEntityData) {
    Set<LevelOfAssurance> transactionLOAs = ImmutableSet.copyOf(transactionConfigEntityData.getLevelsOfAssurance());
    return identityProviderConfigEntityData.stream()
            .filter(idp -> isIdpForTransaction(transactionConfigEntityData, idp))
            .filter(idp -> idpCannotFulfillLoaRequirements(transactionLOAs, idp))
            .collect(Collectors.toList());
}
 
开发者ID:alphagov,项目名称:verify-hub,代码行数:8,代码来源:LevelsOfAssuranceConfigValidator.java

示例9: buildLookup

import com.google.common.collect.ImmutableSet; //导入方法依赖的package包/类
private static PodCIDRLookup buildLookup(Set<String> nodeNames,
    Map<String, Map<String, String>> netmaskToNetworkToNode) {
  ImmutableList.Builder<ImmutablePair<Netmask, ImmutableMap<NetworkAddress, String>>> builder =
      ImmutableList.builder();
  for (Map.Entry<String, Map<String, String>> entry : netmaskToNetworkToNode.entrySet()) {
    Netmask netmask = new Netmask(entry.getKey());
    ImmutableMap.Builder<NetworkAddress, String> networkToNodeBuilder = ImmutableMap.builder();
    for (Map.Entry<String, String> networkToNode : entry.getValue().entrySet()) {
      networkToNodeBuilder.put(new NetworkAddress(networkToNode.getKey()),
          networkToNode.getValue());
    }
    builder.add(ImmutablePair.of(netmask, networkToNodeBuilder.build()));
  }
  return new PodCIDRLookup(builder.build(), ImmutableSet.copyOf(nodeNames));
}
 
开发者ID:apache-spark-on-k8s,项目名称:kubernetes-HDFS,代码行数:16,代码来源:PodCIDRToNodeMapping.java

示例10: queryTunnel

import com.google.common.collect.ImmutableSet; //导入方法依赖的package包/类
@Override
public Collection<Tunnel> queryTunnel(Tunnel.Type type) {
    Collection<Tunnel> result = new HashSet<Tunnel>();

    for (TunnelId tunnelId : tunnelIdAsKeyStore.keySet()) {
        result.add(tunnelIdAsKeyStore.get(tunnelId));
    }

    return result.size() == 0 ? Collections.emptySet() : ImmutableSet.copyOf(result);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:11,代码来源:PceManagerTest.java

示例11: EntityStore

import com.google.common.collect.ImmutableSet; //导入方法依赖的package包/类
public EntityStore(EntityDefinition<E> entityDefinition, Map<RelationDefinition, RelationStore> relationStores) {
    m_entityDefinition = entityDefinition;
    m_entityClass = entityDefinition.getEntityClass();
    m_entityName = entityDefinition.getEntityName();

    IdDefinition idDefinition = entityDefinition.getIdDefinition();
    m_idPropertyName = idDefinition != null ? idDefinition.getIdName() : null;

    m_attributes = ImmutableSet
            .copyOf(entityDefinition.getAttributes().values().stream().map(AttributeDefinition::getAttributeName).collect(Collectors.toList()));

    ImmutableMap.Builder<String, Map<Object, Long>> uniquesIndex = ImmutableMap.builder();
    entityDefinition.getUniqueConstraints().forEach(uniqueAttribute -> uniquesIndex.put(uniqueAttribute, new HashMap<>()));
    m_uniquesIndex = uniquesIndex.build();

    ImmutableSet.Builder<String> nonNullAttributes = ImmutableSet.builder();
    entityDefinition.getAttributes().values().stream() //
            .filter(attributeDefinition -> !attributeDefinition.isNullable()) //
            .forEach(attributeDefinition -> nonNullAttributes.add(attributeDefinition.getAttributeName()));
    m_nonNullAttributes = nonNullAttributes.build();

    ImmutableMap.Builder<String, RelationStore> relationStoresBuilder = ImmutableMap.builder();
    entityDefinition.getRelations().values().forEach(relationDefinition -> {
        RelationStore relationStore = relationStores.get(relationDefinition);
        relationStoresBuilder.put(relationDefinition.getRelationName(), relationStore);
    });
    m_relationStores = relationStoresBuilder.build();
}
 
开发者ID:Axway,项目名称:iron,代码行数:29,代码来源:EntityStore.java

示例12: answers

import com.google.common.collect.ImmutableSet; //导入方法依赖的package包/类
@Override
public Set<Response> answers(final Answerable answerable) {
  return ImmutableSet.copyOf(equivalenceClasses.get(answerable));
}
 
开发者ID:isi-nlp,项目名称:tac-kbp-eal,代码行数:5,代码来源:SystemOutputEquivalenceClasses.java

示例13: registerCallsToConstructor

import com.google.common.collect.ImmutableSet; //导入方法依赖的package包/类
void registerCallsToConstructor(Collection<JavaConstructorCall> calls) {
    this.callsToSelf = ImmutableSet.copyOf(calls);
}
 
开发者ID:TNG,项目名称:ArchUnit,代码行数:4,代码来源:JavaConstructor.java

示例14: validRolesFor

import com.google.common.collect.ImmutableSet; //导入方法依赖的package包/类
public ImmutableSet<Symbol> validRolesFor(Symbol type) {
  checkNotNull(type);
  return ImmutableSet.copyOf(concat(validRoles.get(type), alwaysValidRoles));
}
 
开发者ID:isi-nlp,项目名称:tac-kbp-eal,代码行数:5,代码来源:TypeAndRoleValidator.java

示例15: statusChangeListeners

import com.google.common.collect.ImmutableSet; //导入方法依赖的package包/类
@Override
public Collection<Consumer<Status>> statusChangeListeners() {
    return ImmutableSet.copyOf(statusChangeListeners);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:AtomixLeaderElector.java


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