List of usage examples for com.google.common.collect ImmutableSet of
public static <E> ImmutableSet<E> of(E element)
From source file:grakn.core.graql.gremlin.sets.NotInternalFragmentSet.java
@Override public final Set<Fragment> fragments() { return ImmutableSet.of(Fragments.notInternal(varProperty(), var())); }
From source file:se.sics.caracaldb.operations.OpUtil.java
/** * Puts value if there's no value associated with key currently. * //from w w w . j av a2 s . co m * @param id * @param key * @param value * @return */ public static MultiOpRequest putIfAbsent(UUID id, Key key, byte[] value) { Condition c = new EqualCondition(key, null); return new MultiOpRequest(id, ImmutableSet.of(c), ImmutableMap.of(key, value), ImmutableMap.copyOf(new HashMap<Key, byte[]>())); // see above }
From source file:grakn.core.graql.gremlin.sets.IsAbstractFragmentSet.java
@Override public final Set<Fragment> fragments() { return ImmutableSet.of(isAbstract(varProperty(), var())); }
From source file:org.onosproject.ui.impl.UserPreferencesMessageHandler.java
@Override protected Collection<RequestHandler> createRequestHandlers() { return ImmutableSet.of(new UpdatePreferencesRequest()); }
From source file:be.fror.ecs._processing.EntityFactoryProcessor.java
@Override public Set<String> getSupportedAnnotationTypes() { return ImmutableSet.of(EntityFactory.class.getCanonicalName()); }
From source file:com.google.inject.assistedinject.BindingCollector.java
public BindingCollector addBinding(Key<?> key, TypeLiteral<?> target) { if (bindings.containsKey(key)) { throw new ConfigurationException( ImmutableSet.of(new Message("Only one implementation can be specified for " + key))); }//from w w w . ja v a 2 s . com bindings.put(key, target); return this; }
From source file:org.javersion.object.types.ObjectType.java
@SuppressWarnings("unchecked") public ObjectType(TypeDescriptor type) { this((Class<? extends O>) type.getRawType(), ImmutableSet.of(type)); }
From source file:grakn.core.graql.gremlin.sets.IdFragmentSet.java
@Override public final Set<Fragment> fragments() { return ImmutableSet.of(Fragments.id(varProperty(), var(), id())); }
From source file:com.github.benmanes.caffeine.cache.simulator.policy.product.Ehcache3Policy.java
/** Returns all variations of this policy based on the configuration parameters. */ public static Set<Policy> policies(Config config) { return ImmutableSet.of(new Ehcache3Policy(config)); }
From source file:com.facebook.buck.cli.ResolveAliasHelper.java
/** * Assumes each argument passed to this command is an alias defined in .buckconfig, * or a fully qualified (non-alias) target to be verified by checking the build files. * Prints the build target that each alias maps to on its own line to standard out. *///from ww w . java 2 s . c om public static int resolveAlias(CommandRunnerParams params, ListeningExecutorService executor, boolean enableProfiling, List<String> aliases) { List<String> resolvedAliases = Lists.newArrayList(); for (String alias : aliases) { Set<String> buildTargets; if (alias.startsWith("//")) { String buildTarget = validateBuildTargetForFullyQualifiedTarget(params, executor, enableProfiling, alias, params.getParser()); if (buildTarget == null) { throw new HumanReadableException("%s is not a valid target.", alias); } buildTargets = ImmutableSet.of(buildTarget); } else { buildTargets = getBuildTargetForAlias(params.getBuckConfig(), alias); if (buildTargets.isEmpty()) { throw new HumanReadableException("%s is not an alias.", alias); } } resolvedAliases.addAll(buildTargets); } for (String resolvedAlias : resolvedAliases) { params.getConsole().getStdOut().println(resolvedAlias); } return 0; }