List of usage examples for com.google.common.collect Sets immutableEnumSet
@GwtCompatible(serializable = true) public static <E extends Enum<E>> ImmutableSet<E> immutableEnumSet(Iterable<E> elements)
From source file:com.google.javascript.jscomp.fuzzing.BooleanFuzzer.java
@Override protected Set<Type> supportedTypes() { return Sets.immutableEnumSet(Type.BOOLEAN); }
From source file:com.linecorp.armeria.server.http.dynamic.DynamicHttpFunctionEntry.java
/** * Creates a new instance.//from www. j av a2 s . c o m */ DynamicHttpFunctionEntry(Set<HttpMethod> methods, DynamicPath path, DynamicHttpFunction function) { this.methods = Sets.immutableEnumSet(requireNonNull(methods, "methods")); this.path = requireNonNull(path, "path"); this.function = requireNonNull(function, "function"); }
From source file:com.google.gerrit.server.change.AllowedFormats.java
@Inject AllowedFormats(DownloadConfig cfg) {//w w w . jav a 2 s . c o m Map<String, ArchiveFormat> exts = new HashMap<>(); for (ArchiveFormat format : cfg.getArchiveFormats()) { for (String ext : format.getSuffixes()) { exts.put(ext, format); } exts.put(format.name().toLowerCase(), format); } extensions = ImmutableMap.copyOf(exts); // Zip is not supported because it may be interpreted by a Java plugin as a // valid JAR file, whose code would have access to cookies on the domain. allowed = Sets.immutableEnumSet(Iterables.filter(cfg.getArchiveFormats(), f -> f != ArchiveFormat.ZIP)); }
From source file:com.google.devtools.kythe.doc.MarkedSourceRenderer.java
/** * Extract and render a plaintext initializer from {@link signature}. * * @param makeLink if provided, this function will be used to generate link URIs from semantic * node tickets. It may return null if there is no available URI. * @param signature the {@link MarkedSource} to render from. * @return SafeHtml.EMPTY if there is no such initializer. *//*w ww.j a v a2s. c o m*/ public static SafeHtml renderInitializer(Function<String, SafeUrl> makeLink, MarkedSource signature) { return new RenderSimpleIdentifierState(makeLink).render(signature, Sets.immutableEnumSet(MarkedSource.Kind.INITIALIZER), 0); }
From source file:com.google.javascript.jscomp.fuzzing.SimpleFuzzer.java
@Override protected Set<Type> supportedTypes() { return Sets.immutableEnumSet(dataType); }
From source file:edu.mit.streamjit.util.bytecode.Access.java
private Access(Modifier... modifiers) { this.modifiers = Sets.immutableEnumSet(Arrays.asList(modifiers)); }
From source file:com.google.javascript.jscomp.fuzzing.RegularExprFuzzer.java
@Override protected Set<Type> supportedTypes() { return Sets.immutableEnumSet(Type.OBJECT); }
From source file:org.trnltk.morphology.morphotactics.suffixformspecifications.SuffixFormSpecifications.java
public static Specification<MorphemeContainer> hasLexemeAttributes(LexemeAttribute... lexemeAttributes) { return new HasLexemeAttributes(Sets.immutableEnumSet(Arrays.asList(lexemeAttributes))); }
From source file:com.linecorp.armeria.server.AnnotatedHttpService.java
/** * Creates a new instance.//from w ww . j a v a 2 s . co m */ AnnotatedHttpService(Iterable<HttpMethod> methods, PathMapping pathMapping, BiFunction<ServiceRequestContext, HttpRequest, Object> function) { this.methods = Sets.immutableEnumSet(requireNonNull(methods, "methods")); this.pathMapping = requireNonNull(pathMapping, "pathMapping"); this.function = requireNonNull(function, "function"); }
From source file:com.github.heuermh.personalgenome.client.Relative.java
public Relative(final String profileId, final String matchId, final double similarity, final int sharedSegments, final Relationship relationship, final Relationship userRelationship, final Set<Relationship> range) { checkNotNull(profileId);/* ww w . j a v a 2 s.co m*/ checkNotNull(matchId); this.profileId = profileId; this.matchId = matchId; this.similarity = similarity; this.sharedSegments = sharedSegments; this.relationship = relationship; this.userRelationship = userRelationship; // or return empty? this.range = range == null ? null : Sets.immutableEnumSet(range); }