當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。