List of usage examples for com.google.common.collect ImmutableMap copyOf
public static <K, V> ImmutableMap<K, V> copyOf(Iterable<? extends Entry<? extends K, ? extends V>> entries)
From source file:org.jclouds.azurecompute.arm.domain.ResourceGroup.java
@SerializedNames({ "id", "name", "location", "tags", "properties" }) public static ResourceGroup create(String id, String name, String location, Map<String, String> tags, ResourceGroupProperties properties) { return new AutoValue_ResourceGroup(id, name, location, tags == null ? null : ImmutableMap.copyOf(tags), properties);// ww w . ja va2 s .c o m }
From source file:com.facebook.buck.android.AndroidNdkHelper.java
public static NdkCxxPlatform getNdkCxxPlatform(ProjectWorkspace workspace, ProjectFilesystem filesystem) throws IOException, InterruptedException { // TODO(cjhopman): is this really the simplest way to get the objdump tool? AndroidDirectoryResolver androidResolver = new DefaultAndroidDirectoryResolver( workspace.asCell().getRoot().getFileSystem(), ImmutableMap.copyOf(System.getenv()), Optional.empty(), Optional.empty()); Optional<Path> ndkPath = androidResolver.getNdkOrAbsent(); assertTrue(ndkPath.isPresent());/*w w w . j a va 2 s. co m*/ Optional<String> ndkVersion = DefaultAndroidDirectoryResolver.findNdkVersionFromDirectory(ndkPath.get()); String gccVersion = NdkCxxPlatforms.getDefaultGccVersionForNdk(ndkVersion); ImmutableCollection<NdkCxxPlatform> platforms = NdkCxxPlatforms .getPlatforms(CxxPlatformUtils.DEFAULT_CONFIG, filesystem, ndkPath.get(), NdkCxxPlatformCompiler.builder().setType(NdkCxxPlatforms.DEFAULT_COMPILER_TYPE) .setVersion(gccVersion).setGccVersion(gccVersion).build(), NdkCxxPlatforms.DEFAULT_CXX_RUNTIME, NdkCxxPlatforms.DEFAULT_TARGET_APP_PLATFORM, NdkCxxPlatforms.DEFAULT_CPU_ABIS, Platform.detect()) .values(); assertFalse(platforms.isEmpty()); return platforms.iterator().next(); }
From source file:ratpack.groovy.templating.internal.DefaultTemplate.java
public DefaultTemplate(String id, Map<String, ?> model, String type) { this.id = id; this.type = type; this.model = ImmutableMap.copyOf(model); }
From source file:org.javersion.store.jdbc.GraphResults.java
public GraphResults(Map<Id, ObjectVersionGraph<M>> graphsByDocId, Revision latestRevision) { this.graphsByDocId = ImmutableMap.copyOf(graphsByDocId); this.latestRevision = latestRevision; }
From source file:com.google.javascript.jscomp.GatherGettersAndSetterProperties.java
static ImmutableMap<String, PropertyAccessKind> gather(AbstractCompiler compiler, Node root) { GatherCallback gatherCallback = new GatherCallback(); NodeTraversal.traverse(compiler, root, gatherCallback); return ImmutableMap.copyOf(gatherCallback.properties); }
From source file:com.facebook.buck.cxx.AbstractCxxSourceSet.java
@Value.Lazy public ImmutableMap<String, CxxSource> toSourcesMap() { return ImmutableMap.copyOf(getSourcesSet()); }
From source file:org.jclouds.aliyun.ecs.domain.Zone.java
@SerializedNames({ "ZoneId", "LocalName", "DedicatedHostGenerations", "AvailableResourceCreation", "AvailableDedicatedHostTypes", "AvailableResources", "AvailableInstanceTypes", "AvailableVolumeCategories", "AvailableDiskCategories" }) public static Zone create(String id, String localName, Map<String, List<Object>> dedicatedHostGenerations, // FIXME neither doc nor example showed the type in the list Map<String, List<String>> availableResourceCreation, Map<String, List<String>> availableDedicatedHostTypes, Map<String, List<ResourceInfo>> availableResources, Map<String, List<String>> availableInstanceTypes, Map<String, List<String>> availableVolumeCategories, Map<String, List<String>> availableDiskCategories) { return new AutoValue_Zone(id, localName, dedicatedHostGenerations == null ? ImmutableMap.<String, List<Object>>of() : ImmutableMap.copyOf(dedicatedHostGenerations), availableResourceCreation == null ? ImmutableMap.<String, List<String>>of() : ImmutableMap.copyOf(availableResourceCreation), availableDedicatedHostTypes == null ? ImmutableMap.<String, List<String>>of() : ImmutableMap.copyOf(availableDedicatedHostTypes), availableResources == null ? ImmutableMap.<String, List<ResourceInfo>>of() : ImmutableMap.copyOf(availableResources), availableInstanceTypes == null ? ImmutableMap.<String, List<String>>of() : ImmutableMap.copyOf(availableInstanceTypes), availableVolumeCategories == null ? ImmutableMap.<String, List<String>>of() : ImmutableMap.copyOf(availableVolumeCategories), availableDiskCategories == null ? ImmutableMap.<String, List<String>>of() : ImmutableMap.copyOf(availableDiskCategories)); }
From source file:appeng.client.render.cablebus.CableCoreType.java
/** * Creates the mapping that assigns a cable core type to an AE cable type. *//*w ww. ja va 2s . co m*/ private static Map<AECableType, CableCoreType> generateCableMapping() { Map<AECableType, CableCoreType> result = new EnumMap<>(AECableType.class); result.put(AECableType.GLASS, CableCoreType.GLASS); result.put(AECableType.COVERED, CableCoreType.COVERED); result.put(AECableType.SMART, CableCoreType.COVERED); result.put(AECableType.DENSE, CableCoreType.DENSE); return ImmutableMap.copyOf(result); }
From source file:ru.org.linux.user.PreparedUserLogItem.java
public PreparedUserLogItem(UserLogItem item, User actionUser, Map<String, String> options) { this.item = item; this.actionUser = actionUser; this.options = ImmutableMap.copyOf(options); self = item.getUser() == item.getActionUser(); }
From source file:co.cask.cdap.proto.WorkflowTokenNodeDetail.java
public WorkflowTokenNodeDetail(Map<String, String> tokenDataAtNode) { this.tokenDataAtNode = ImmutableMap.copyOf(tokenDataAtNode); }