List of usage examples for java.lang Boolean toString
public static String toString(boolean b)
From source file:org.talend.dataprep.api.service.command.dataset.DataSetList.java
private HttpRequestBase onExecute(Sort sort, Order order, String name, boolean certified, boolean favorite, boolean limit) { try {//from w w w. jav a 2 s . c o m URIBuilder uriBuilder = new URIBuilder(datasetServiceUrl + "/datasets"); uriBuilder.addParameter("sort", sort.camelName()); uriBuilder.addParameter("order", order.camelName()); uriBuilder.addParameter("name", name); uriBuilder.addParameter("certified", Boolean.toString(certified)); uriBuilder.addParameter("favorite", Boolean.toString(favorite)); uriBuilder.addParameter("limit", Boolean.toString(limit)); return new HttpGet(uriBuilder.build()); } catch (URISyntaxException e) { throw new TDPException(CommonErrorCodes.UNEXPECTED_EXCEPTION, e); } }
From source file:com.ts.db.connector.ConnectorMap.java
public Properties toProperties() { Properties props = new Properties(); for (String id : keySet()) { Connector connector = getConnector(id); Password password = connector.getPassword(); props.setProperty(id + ".name", connector.getName()); props.setProperty(id + ".driver", connector.getDriver()); props.setProperty(id + ".classpath", connector.getClasspath()); props.setProperty(id + ".url", connector.getUrl()); props.setProperty(id + ".user", connector.getUser()); props.setProperty(id + ".password", password.getTransformedString()); props.setProperty(id + ".password.class", password.getClass().getName()); props.setProperty(id + ".readonly", Boolean.toString(connector.isReadOnly())); props.setProperty(id + ".rollback", Boolean.toString(connector.usesAutoRollback())); }//from w w w.j a v a 2 s .c o m return props; }
From source file:com.github.fengtan.sophie.tables.FieldsTable.java
@Override protected void populate() throws SophieException { // Get remote fields + unique key. String uniqueField = SolrUtils.getRemoteUniqueField(); List<FieldInfo> fields = SolrUtils.getRemoteFields(); // Populate table. for (FieldInfo field : fields) { Map<String, String> values = new HashMap<String, String>(); values.put("Name", field.getName()); values.put("Type", field.getType()); values.put("Unique", Boolean.toString(StringUtils.equals(field.getName(), uniqueField))); values.put("Distinct", Integer.toString(field.getDistinct())); values.put("Schema", field.getSchema()); for (FieldFlag flag : FieldFlag.values()) { EnumSet<FieldFlag> flags = SolrUtils.getFlags(field); values.put(flag.getDisplay(), Boolean.toString(flags.contains(flag))); }//from w ww .java 2s . co m addRow(values); } }
From source file:org.apache.archiva.redback.rbac.jdo.JdoTool.java
public static void dumpObjectState(PrintStream out, Object o) { final String STATE = "[STATE] "; final String INDENT = " "; if (o == null) { out.println(STATE + "Object is null."); return;/* ww w . jav a 2 s . c om*/ } out.println(STATE + "Object " + o.getClass().getName()); if (!(o instanceof PersistenceCapable)) { out.println(INDENT + "is NOT PersistenceCapable (not a jdo object?)"); return; } out.println(INDENT + "is PersistenceCapable."); if (o instanceof Detachable) { out.println(INDENT + "is Detachable"); } out.println(INDENT + "is new : " + Boolean.toString(JDOHelper.isNew(o))); out.println(INDENT + "is transactional : " + Boolean.toString(JDOHelper.isTransactional(o))); out.println(INDENT + "is deleted : " + Boolean.toString(JDOHelper.isDeleted(o))); out.println(INDENT + "is detached : " + Boolean.toString(JDOHelper.isDetached(o))); out.println(INDENT + "is dirty : " + Boolean.toString(JDOHelper.isDirty(o))); out.println(INDENT + "is persistent : " + Boolean.toString(JDOHelper.isPersistent(o))); out.println(INDENT + "object id : " + JDOHelper.getObjectId(o)); }
From source file:atg.tools.dynunit.test.configuration.RepositoryConfiguration.java
private String debug() { return Boolean.toString(isDebug()); }
From source file:info.magnolia.cms.util.NodeDataUtil.java
/** * <p/> Returns the representation of the value as a String: * </p>/*w ww .j a va 2 s . c o m*/ * @return String */ public String getValueString(String dateFormat) { try { NodeData nodeData = this.getNodeData(); switch (nodeData.getType()) { case (PropertyType.STRING): return nodeData.getString(); case (PropertyType.DOUBLE): return Double.toString(nodeData.getDouble()); case (PropertyType.LONG): return Long.toString(nodeData.getLong()); case (PropertyType.BOOLEAN): return Boolean.toString(nodeData.getBoolean()); case (PropertyType.DATE): Date valueDate = nodeData.getDate().getTime(); return new DateUtil().getFormattedDate(valueDate, dateFormat); case (PropertyType.BINARY): // ??? default: return StringUtils.EMPTY; } } catch (Exception e) { if (log.isDebugEnabled()) log.debug("Exception caught: " + e.getMessage(), e); //$NON-NLS-1$ } return StringUtils.EMPTY; }
From source file:com.dvidder.service.AccountService.java
public String getAccountInfo(String param) { Account account = accountRepository.findByUsername(profileService.getCurrentUsername()); if (param.equals("username")) { return account.getUsername(); } else if (param.equals("admin")) { return Boolean.toString(account.isAdmin()); } else {//w w w . ja va 2 s . c o m return "error"; } }
From source file:com.esri.geoportal.harvester.api.base.BotsBrokerDefinitionAdaptor.java
/** * Sets bots config.//from w w w. j av a 2 s . c o m * * @param botsConfig bots config */ public void setBotsConfig(BotsConfig botsConfig) { set(P_BOTS_AGENT, botsConfig.getUserAgent()); set(P_BOTS_ENABLED, Boolean.toString(botsConfig.isEnabled())); set(P_BOTS_OVERRIDE, Boolean.toString(botsConfig.isOverride())); }
From source file:com.celements.sajson.Parser.java
public void parse(String jsonExpression) throws JsonParseException, IOException { StringReader jsonReader = new StringReader(jsonExpression); try {/*from w w w .jav a 2s. c o m*/ parser = factory.createJsonParser(jsonReader); workerStack.clear(); JsonToken nextToken = parser.nextToken(); lexParser.initEvent(); while (parser.hasCurrentToken()) { switch (nextToken) { case VALUE_TRUE: case VALUE_FALSE: boolean boolValue = parser.getBooleanValue(); lastValue = Boolean.toString(boolValue); lexParser.booleanEvent(boolValue); impliciteCloseProperty(); break; case VALUE_STRING: lastValue = parser.getText(); lexParser.stringEvent(lastValue); impliciteCloseProperty(); break; case START_ARRAY: checkIllegalStackState(ECommand.DICTIONARY_COMMAND, nextToken); workerStack.push(ECommand.ARRAY_COMMAND); lexParser.openArrayEvent(); break; case END_ARRAY: checkStackState(ECommand.ARRAY_COMMAND); lexParser.closeArrayEvent(); workerStack.pop(); impliciteCloseProperty(); break; case START_OBJECT: checkIllegalStackState(ECommand.DICTIONARY_COMMAND, nextToken); workerStack.push(ECommand.DICTIONARY_COMMAND); lexParser.openDictionaryEvent(); break; case END_OBJECT: checkStackState(ECommand.DICTIONARY_COMMAND); lexParser.closeDictionaryEvent(); workerStack.pop(); impliciteCloseProperty(); break; case FIELD_NAME: checkStackState(ECommand.DICTIONARY_COMMAND); workerStack.push(ECommand.PROPERTY_COMMAND); lastKey = parser.getText(); lexParser.openPropertyEvent(lastKey); break; default: LOGGER.warn("unkown token [" + nextToken + "] lastKey [" + lastKey + "] lastValue [" + lastValue + "]."); break; } nextToken = parser.nextToken(); } lexParser.finishEvent(); } finally { jsonReader.close(); } }
From source file:co.runrightfast.vertx.orientdb.config.OHazelcastPluginConfig.java
@Override public OServerHandlerConfiguration get() { final OServerHandlerConfiguration config = new OServerHandlerConfiguration(); config.clazz = OrientDBPluginWithProvidedHazelcastInstance.class.getName(); config.parameters = new OServerParameterConfiguration[] { new OServerParameterConfiguration("enabled", Boolean.toString(enabled)), new OServerParameterConfiguration("nodeName", nodeName), new OServerParameterConfiguration( "configuration.db.default", distributedDBConfigFilePath.toAbsolutePath().toString()) }; return config; }