List of usage examples for java.lang Boolean toString
public static String toString(boolean b)
From source file:samples.dynamodb.KinesisMessageModelDynamoDBTransformer.java
/** * Helper method to map boolean attributes to an AttributeValue. * //from w w w.j ava 2 s .c o m * @param item The map of attribute names to AttributeValues to store the attribute in * @param key The key to store in the map * @param value The value to insert into the item map */ private void putBoolIfNonempty(Map<String, AttributeValue> item, String key, Boolean value) { putStringIfNonempty(item, key, Boolean.toString(value)); }
From source file:com.nesscomputing.jersey.NessJerseyServletModule.java
Map<String, String> getJerseyFeatures(final JerseyConfig jerseyConfig) { final Map<String, String> jerseyFeatures = Maps.newHashMap(); jerseyFeatures.put(ResourceConfig.FEATURE_TRACE, Boolean.toString(jerseyConfig.isTraceEnabled())); jerseyFeatures.put(ResourceConfig.FEATURE_TRACE_PER_REQUEST, Boolean.toString(jerseyConfig.isTracePerRequestEnabled())); jerseyFeatures.put(ResourceConfig.FEATURE_DISABLE_WADL, Boolean.toString(!jerseyConfig.isGenerateWadlEnabled())); // Expose the @RequiresAuthentication annotation jerseyFeatures.put(ResourceConfig.PROPERTY_WADL_GENERATOR_CONFIG, NessWadlAnnotationsConfig.class.getName()); return jerseyFeatures; }
From source file:com.jaeksoft.searchlib.webservice.client.RestJsonClient.java
public void injectSwiftRepository(HttpDownloader downloader, String indexName, String authURL, AuthType authType, String username, String password, String tenant, String container, String path, boolean ignoreHiddenFile, boolean includeSubDirectory, boolean enabled, int delay) throws ClientProtocolException, IllegalStateException, IOException, SearchLibException, URISyntaxException, JSONException { JsonTransaction transaction = new JsonTransaction(this, "/crawler/file/repository/inject/swift/{index}/json", indexName); transaction.addParam("path", ""); transaction.addParam("ignoreHiddenFile", Boolean.toString(ignoreHiddenFile)); transaction.addParam("includeSubDirectory", Boolean.toString(includeSubDirectory)); transaction.addParam("enabled", Boolean.toString(enabled)); transaction.addParam("delay", Integer.toString(delay)); transaction.addParam("username", username); transaction.addParam("password", password); transaction.addParam("tenant", tenant); transaction.addParam("container", container); transaction.addParam("authUrl", authURL); transaction.addParam("authType", authType.name()); transaction.put(downloader);//from ww w. j a va 2s . c o m }
From source file:gobblin.writer.jdbc.JdbcWriterInitializerTest.java
public void skipStagingTableTruncateDestTable() throws SQLException { this.state.setProp(ConfigurationKeys.JOB_COMMIT_POLICY_KEY, "partial"); this.state.setProp(ConfigurationKeys.PUBLISH_DATA_AT_JOB_LEVEL, Boolean.toString(false)); this.state.setProp(JdbcPublisher.JDBC_PUBLISHER_REPLACE_FINAL_TABLE, Boolean.toString(true)); this.initializer.initialize(); Assert.assertEquals(DEST_TABLE, this.workUnit.getProp(ConfigurationKeys.WRITER_STAGING_TABLE)); verify(this.commands, never()).createTableStructure(anyString(), anyString(), anyString()); InOrder inOrder = inOrder(this.commands); inOrder.verify(this.commands, times(1)).truncate(DB, DEST_TABLE); this.initializer.close(); inOrder.verify(this.commands, never()).truncate(anyString(), anyString()); verify(this.commands, never()).drop(anyString(), anyString()); }
From source file:net.sourceforge.fenixedu.dataTransferObject.inquiries.InquiryBlockDTO.java
public String validate(Set<InquiryBlockDTO> inquiryBlocks) { Set<InquiryGroupQuestionBean> groups = getInquiryGroups(); String validationResult = null; for (InquiryGroupQuestionBean group : groups) { validationResult = group.validate(inquiryBlocks); if (!Boolean.valueOf(validationResult)) { return validationResult; }/* w w w.ja v a 2 s .c om*/ } return Boolean.toString(true); }
From source file:bluej.collect.CollectUtility.java
/** * Converts the boolean to a StringBody */ static StringBody toBody(boolean b) { return toBody(Boolean.toString(b)); }
From source file:it.biztech.btable.util.Utils.java
public static String getJsonResult(boolean success, Object result) { final JSONObject jsonResult = new JSONObject(); jsonResult.put("status", Boolean.toString(success)); if (result != null) { jsonResult.put("result", result); }/* w ww . j av a 2s.c o m*/ return jsonResult.toString(2); }
From source file:com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.deck.DeckProfileFactory.java
@Override protected void setProfile(Profile profile, DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) { StringResource configTemplate = new StringResource(profile.getBaseContents()); UiSecurity uiSecurity = deploymentConfiguration.getSecurity().getUiSecurity(); profile.setUser(ApacheSettings.APACHE_USER); Features features = deploymentConfiguration.getFeatures(); Map<String, String> bindings = new HashMap<>(); String version = deploymentConfiguration.getVersion(); // Configure global settings bindings.put("gate.baseUrl", endpoints.getServices().getGate().getBaseUrl()); bindings.put("timezone", deploymentConfiguration.getTimezone()); bindings.put("version", deploymentConfiguration.getVersion()); Optional<Versions.Version> validatedVersion = versionsService.getVersions().getVersion(version); validatedVersion.ifPresent(v -> { String changelog = v.getChangelog(); bindings.put("changelog.gist.id", changelog.substring(changelog.lastIndexOf("/") + 1)); bindings.put("changelog.gist.name", "changelog.md"); });// w w w .j av a2 s. co m // Configure feature-flags bindings.put("features.auth", Boolean.toString(features.isAuth(deploymentConfiguration))); bindings.put("features.chaos", Boolean.toString(features.isChaos())); bindings.put("features.jobs", Boolean.toString(features.isJobs())); bindings.put("features.fiat", Boolean.toString(deploymentConfiguration.getSecurity().getAuthz().isEnabled())); // Configure Kubernetes KubernetesProvider kubernetesProvider = deploymentConfiguration.getProviders().getKubernetes(); bindings.put("kubernetes.default.account", kubernetesProvider.getPrimaryAccount()); bindings.put("kubernetes.default.namespace", "default"); bindings.put("kubernetes.default.proxy", "localhost:8001"); // Configure GCE GoogleProvider googleProvider = deploymentConfiguration.getProviders().getGoogle(); bindings.put("google.default.account", googleProvider.getPrimaryAccount()); bindings.put("google.default.region", "us-central1"); bindings.put("google.default.zone", "us-central1-f"); // Configure Azure AzureProvider azureProvider = deploymentConfiguration.getProviders().getAzure(); bindings.put("azure.default.account", azureProvider.getPrimaryAccount()); bindings.put("azure.default.region", "westus"); // Configure Appengine AppengineProvider appengineProvider = deploymentConfiguration.getProviders().getAppengine(); bindings.put("appengine.default.account", appengineProvider.getPrimaryAccount()); bindings.put("appengine.enabled", Boolean.toString(appengineProvider.getPrimaryAccount() != null)); // Configure DC/OS final DCOSProvider dcosProvider = deploymentConfiguration.getProviders().getDcos(); bindings.put("dcos.default.account", dcosProvider.getPrimaryAccount()); //TODO(willgorman) need to set the proxy url somehow // Configure Openstack OpenstackProvider openstackProvider = deploymentConfiguration.getProviders().getOpenstack(); bindings.put("openstack.default.account", openstackProvider.getPrimaryAccount()); if (openstackProvider.getPrimaryAccount() != null) { OpenstackAccount openstackAccount = (OpenstackAccount) accountService.getProviderAccount( deploymentConfiguration.getName(), "openstack", openstackProvider.getPrimaryAccount()); //Regions in openstack are a comma separated list. Use the first as primary. String firstRegion = StringUtils.substringBefore(openstackAccount.getRegions(), ","); bindings.put("openstack.default.region", firstRegion); } profile.appendContents(configTemplate.setBindings(bindings).toString()) .setRequiredFiles(backupRequiredFiles(uiSecurity, deploymentConfiguration.getName())); }
From source file:gobblin.runtime.embedded.EmbeddedGobblinDistcp.java
/** * Specifies that files in the target should be updated if they have changed in the source. Equivalent to -update * option in Hadoop distcp.//w w w .j a v a 2 s .co m */ @EmbeddedGobblinCliOption(description = "Specifies files should be updated if they're different in the source.") public EmbeddedGobblinDistcp update() { this.setConfiguration(RecursiveCopyableDataset.UPDATE_KEY, Boolean.toString(true)); return this; }
From source file:com.esri.geoportal.harvester.gpt.GptBrokerDefinitionAdaptor.java
/** * Sets permission to cleanup.//from w w w . jav a 2 s. c om * @param cleanup <code>true</code> to permit cleanup */ public void setCleanup(boolean cleanup) { this.cleanup = cleanup; set(P_CLEANUP, Boolean.toString(cleanup)); }