List of usage examples for java.util LinkedHashMap put
V put(K key, V value);
From source file:com.thoughtworks.go.plugin.access.authorization.AuthorizationMessageConverterV1.java
@Override public String getProcessRoleConfigsResponseBody(List<PluginRoleConfig> roles) { List<Map> list = new ArrayList<>(); for (PluginRoleConfig role : roles) { LinkedHashMap<String, Object> e = new LinkedHashMap<>(); e.put("name", role.getName().toString()); e.put("configuration", role.getConfigurationAsMap(true)); list.add(e);//from www . j a va 2s. c o m } return GSON.toJson(list); }
From source file:io.pivotal.cla.config.SecurityConfig.java
private AuthenticationEntryPoint entryPoint() { LinkedHashMap<RequestMatcher, AuthenticationEntryPoint> entryPoints = new LinkedHashMap<>(); entryPoints.put(new AntPathRequestMatcher("/github/hooks/**"), new HttpStatusEntryPoint(HttpStatus.UNAUTHORIZED)); entryPoints.put(new AntPathRequestMatcher("/admin/**"), new GitHubAuthenticationEntryPoint( oauthConfig.getMain(), "user:email,repo:status,admin:repo_hook,admin:org_hook,read:org")); BasicAuthenticationEntryPoint basicEntryPoint = new BasicAuthenticationEntryPoint(); basicEntryPoint.setRealmName("Pivotal CLA"); entryPoints.put(new AntPathRequestMatcher("/manage/**"), basicEntryPoint); DelegatingAuthenticationEntryPoint entryPoint = new DelegatingAuthenticationEntryPoint(entryPoints); entryPoint.setDefaultEntryPoint(new GitHubAuthenticationEntryPoint(oauthConfig.getMain(), "user:email")); return entryPoint; }
From source file:com.fortify.bugtracker.tgt.octane.processor.OctaneTargetProcessorSubmitIssues.java
@Override protected TargetIssueLocator submitIssue(Context context, LinkedHashMap<String, Object> issueData) { OctaneAuthenticatingRestConnection conn = OctaneConnectionFactory.getConnection(context); issueData.put("name", StringUtils.abbreviate((String) issueData.get("name"), 254)); return conn.submitIssue( new OctaneSharedSpaceAndWorkspaceId(ICLIOptionsOctane.CLI_OCTANE_SHARED_SPACE_UID.getValue(context), ICLIOptionsOctane.CLI_OCTANE_WORKSPACE_ID.getValue(context)), issueData);/* w w w . j a va2 s . c om*/ }
From source file:net.minecraftforge.registries.GameData.java
@SuppressWarnings({ "unchecked", "rawtypes" }) public static Multimap<ResourceLocation, ResourceLocation> injectSnapshot( Map<ResourceLocation, ForgeRegistry.Snapshot> snapshot, boolean injectFrozenData, boolean isLocalWorld) { FMLLog.log.info("Injecting existing registry data into this {} instance", FMLCommonHandler.instance().getEffectiveSide().isServer() ? "server" : "client"); RegistryManager.ACTIVE.registries.forEach((name, reg) -> reg.validateContent(name)); RegistryManager.ACTIVE.registries.forEach((name, reg) -> reg.dump(name)); RegistryManager.ACTIVE.registries.forEach((name, reg) -> reg.resetDelegates()); List<ResourceLocation> missingRegs = snapshot.keySet().stream() .filter(name -> !RegistryManager.ACTIVE.registries.containsKey(name)).collect(Collectors.toList()); if (missingRegs.size() > 0) { String text = "Forge Mod Loader detected missing/unknown registrie(s).\n\n" + "There are " + missingRegs.size() + " missing registries in this save.\n" + "If you continue the missing registries will get removed.\n" + "This may cause issues, it is advised that you create a world backup before continuing.\n\n" + "Missing Registries:\n"; for (ResourceLocation s : missingRegs) text += s.toString() + "\n"; if (!StartupQuery.confirm(text)) StartupQuery.abort();// w ww . j av a 2 s. c o m } RegistryManager STAGING = new RegistryManager("STAGING"); final Map<ResourceLocation, Map<ResourceLocation, Integer[]>> remaps = Maps.newHashMap(); final LinkedHashMap<ResourceLocation, Map<ResourceLocation, Integer>> missing = Maps.newLinkedHashMap(); // Load the snapshot into the "STAGING" registry snapshot.forEach((key, value) -> { final Class<? extends IForgeRegistryEntry> clazz = RegistryManager.ACTIVE.getSuperType(key); remaps.put(key, Maps.newLinkedHashMap()); missing.put(key, Maps.newHashMap()); loadPersistentDataToStagingRegistry(RegistryManager.ACTIVE, STAGING, remaps.get(key), missing.get(key), key, value, clazz); }); snapshot.forEach((key, value) -> { value.dummied.forEach(dummy -> { Map<ResourceLocation, Integer> m = missing.get(key); ForgeRegistry<?> reg = STAGING.getRegistry(key); // Currently missing locally, we just inject and carry on if (m.containsKey(dummy)) { if (reg.markDummy(dummy, m.get(dummy))) m.remove(dummy); } else if (isLocalWorld) { if (ForgeRegistry.DEBUG) FMLLog.log.debug("Registry {}: Resuscitating dummy entry {}", key, dummy); } else { // The server believes this is a dummy block identity, but we seem to have one locally. This is likely a conflict // in mod setup - Mark this entry as a dummy int id = reg.getID(dummy); FMLLog.log.warn( "Registry {}: The ID {} is currently locally mapped - it will be replaced with a dummy for this session", key, id); reg.markDummy(dummy, id); } }); }); int count = missing.values().stream().mapToInt(Map::size).sum(); if (count > 0) { FMLLog.log.debug("There are {} mappings missing - attempting a mod remap", count); Multimap<ResourceLocation, ResourceLocation> defaulted = ArrayListMultimap.create(); Multimap<ResourceLocation, ResourceLocation> failed = ArrayListMultimap.create(); missing.entrySet().stream().filter(e -> e.getValue().size() > 0).forEach(m -> { ResourceLocation name = m.getKey(); ForgeRegistry<?> reg = STAGING.getRegistry(name); RegistryEvent.MissingMappings<?> event = reg.getMissingEvent(name, m.getValue()); MinecraftForge.EVENT_BUS.post(event); List<MissingMappings.Mapping<?>> lst = event.getAllMappings().stream() .filter(e -> e.getAction() == MissingMappings.Action.DEFAULT).collect(Collectors.toList()); if (!lst.isEmpty()) { FMLLog.log.error("Unidentified mapping from registry {}", name); lst.forEach(map -> { FMLLog.log.error(" {}: {}", map.key, map.id); if (!isLocalWorld) defaulted.put(name, map.key); }); } event.getAllMappings().stream().filter(e -> e.getAction() == MissingMappings.Action.FAIL) .forEach(fail -> failed.put(name, fail.key)); final Class<? extends IForgeRegistryEntry> clazz = RegistryManager.ACTIVE.getSuperType(name); processMissing(clazz, name, STAGING, event, m.getValue(), remaps.get(name), defaulted.get(name), failed.get(name)); }); if (!defaulted.isEmpty() && !isLocalWorld) return defaulted; if (!defaulted.isEmpty()) { StringBuilder buf = new StringBuilder(); buf.append("Forge Mod Loader detected missing registry entries.\n\n").append("There are ") .append(defaulted.size()).append(" missing entries in this save.\n") .append("If you continue the missing entries will get removed.\n") .append("A world backup will be automatically created in your saves directory.\n\n"); defaulted.asMap().forEach((name, entries) -> { buf.append("Missing ").append(name).append(":\n"); entries.forEach(rl -> buf.append(" ").append(rl).append("\n")); }); boolean confirmed = StartupQuery.confirm(buf.toString()); if (!confirmed) StartupQuery.abort(); try { String skip = System.getProperty("fml.doNotBackup"); if (skip == null || !"true".equals(skip)) { ZipperUtil.backupWorld(); } else { for (int x = 0; x < 10; x++) FMLLog.log.error("!!!!!!!!!! UPDATING WORLD WITHOUT DOING BACKUP !!!!!!!!!!!!!!!!"); } } catch (IOException e) { StartupQuery.notify("The world backup couldn't be created.\n\n" + e); StartupQuery.abort(); } } if (!defaulted.isEmpty()) { if (isLocalWorld) FMLLog.log.error( "There are unidentified mappings in this world - we are going to attempt to process anyway"); } } if (injectFrozenData) { // If we're loading from disk, we can actually substitute air in the block map for anything that is otherwise "missing". This keeps the reference in the map, in case // the block comes back later missing.forEach((name, m) -> { ForgeRegistry<?> reg = STAGING.getRegistry(name); m.forEach((rl, id) -> reg.markDummy(rl, id)); }); // If we're loading up the world from disk, we want to add in the new data that might have been provisioned by mods // So we load it from the frozen persistent registry RegistryManager.ACTIVE.registries.forEach((name, reg) -> { final Class<? extends IForgeRegistryEntry> clazz = RegistryManager.ACTIVE.getSuperType(name); loadFrozenDataToStagingRegistry(STAGING, name, remaps.get(name), clazz); }); } // Validate that all the STAGING data is good STAGING.registries.forEach((name, reg) -> reg.validateContent(name)); // Load the STAGING registry into the ACTIVE registry for (Map.Entry<ResourceLocation, ForgeRegistry<? extends IForgeRegistryEntry<?>>> r : RegistryManager.ACTIVE.registries .entrySet()) { final Class<? extends IForgeRegistryEntry> registrySuperType = RegistryManager.ACTIVE .getSuperType(r.getKey()); loadRegistry(r.getKey(), STAGING, RegistryManager.ACTIVE, registrySuperType, true); } // Dump the active registry RegistryManager.ACTIVE.registries.forEach((name, reg) -> reg.dump(name)); // Tell mods that the ids have changed Loader.instance().fireRemapEvent(remaps, false); // The id map changed, ensure we apply object holders ObjectHolderRegistry.INSTANCE.applyObjectHolders(); // Return an empty list, because we're good return ArrayListMultimap.create(); }
From source file:com.ikanow.infinit.e.data_model.store.config.source.SourcePojo.java
private static LinkedHashMap<String, String> decodeKeysForDatabaseStorage(LinkedHashMap<String, String> in) { LinkedHashMap<String, String> transformed = new LinkedHashMap<String, String>(); for (Map.Entry<String, String> entry : in.entrySet()) { transformed.put(entry.getKey().replace("%2e", "."), entry.getValue()); }// ww w. j a v a2 s . c o m return transformed; }
From source file:com.ikanow.infinit.e.data_model.store.config.source.SourcePojo.java
private static LinkedHashMap<String, String> encodeKeysForDatabaseStorage(LinkedHashMap<String, String> in) { LinkedHashMap<String, String> transformed = new LinkedHashMap<String, String>(); for (Map.Entry<String, String> entry : in.entrySet()) { transformed.put(entry.getKey().replace(".", "%2e"), entry.getValue()); }// w w w.ja v a 2 s . c om return transformed; }
From source file:hydrograph.ui.propertywindow.filter.FilterLogicWidget.java
@Override public LinkedHashMap<String, Object> getProperties() { LinkedHashMap<String, Object> property = new LinkedHashMap<>(); property.put(propertyName, dataStructure); return property; }
From source file:net.sourceforge.jabm.report.AbstractReportVariables.java
public Map<Object, Number> getVariableBindings() { LinkedHashMap<Object, Number> result = new LinkedHashMap<Object, Number>(); result.put(this.xVariableName, timeStamp); return result; }
From source file:com.intel.iotkitlib.LibModules.InvitationManagement.java
public boolean getInvitationListSendToSpecificUser(String emailId) { if (emailId == null) { Log.d(TAG, "emailId cannot be null"); return false; }//from www . ja v a 2s .co m //initiating get for invitation list send to specific user HttpGetTask listInvitationToSpecificUser = new HttpGetTask(new HttpTaskHandler() { @Override public void taskResponse(int responseCode, String response) { Log.d(TAG, String.valueOf(responseCode)); Log.d(TAG, response); statusHandler.readResponse(responseCode, response); } }); listInvitationToSpecificUser.setHeaders(basicHeaderList); LinkedHashMap<String, String> linkedHashMap = new LinkedHashMap<String, String>(); linkedHashMap.put("email", emailId); String url = objIotKit.prepareUrl(objIotKit.getInvitationListSendToSpecificUser, linkedHashMap); return super.invokeHttpExecuteOnURL(url, listInvitationToSpecificUser, "list invitation to specific user"); }
From source file:com.intel.iotkitlib.LibModules.InvitationManagement.java
public boolean deleteInvitations(String emailId) { if (emailId == null) { Log.d(TAG, "emailId cannot be null"); return false; }//w w w. j a va2s . c o m //initiating delete for invitation deletion HttpDeleteTask deleteTheInvitations = new HttpDeleteTask(new HttpTaskHandler() { @Override public void taskResponse(int responseCode, String response) { Log.d(TAG, String.valueOf(responseCode)); Log.d(TAG, response); statusHandler.readResponse(responseCode, response); } }); deleteTheInvitations.setHeaders(basicHeaderList); LinkedHashMap<String, String> linkedHashMap = new LinkedHashMap<String, String>(); linkedHashMap.put("email", emailId); String url = objIotKit.prepareUrl(objIotKit.deleteInvitations, linkedHashMap); return super.invokeHttpExecuteOnURL(url, deleteTheInvitations, "delete invitations"); }