List of usage examples for java.lang Boolean toString
public static String toString(boolean b)
From source file:co.runrightfast.vertx.orientdb.config.OServerSideScriptInterpreterConfig.java
@Override public OServerHandlerConfiguration get() { final OServerHandlerConfiguration config = new OServerHandlerConfiguration(); config.clazz = OServerSideScriptInterpreter.class.getName(); config.parameters = new OServerParameterConfiguration[] { new OServerParameterConfiguration("enabled", Boolean.toString(enabled)), new OServerParameterConfiguration("allowedLanguages", allowedLanguages.stream().collect(Collectors.joining(","))) }; return config; }
From source file:com.esri.geoportal.harvester.api.base.BotsBrokerDefinitionAdaptor.java
/** * Gets bots config.//from ww w .j a v a 2 s .co m * * @return bots config */ public BotsConfig getBotsConfig() { return new BotsConfigImpl(StringUtils.defaultIfBlank(get(P_BOTS_AGENT), BotsConfig.DEFAULT.getUserAgent()), BooleanUtils.toBoolean(StringUtils.defaultIfBlank(get(P_BOTS_ENABLED), Boolean.toString(BotsConfig.DEFAULT.isEnabled()))), BooleanUtils.toBoolean(StringUtils.defaultIfBlank(get(P_BOTS_OVERRIDE), Boolean.toString(BotsConfig.DEFAULT.isOverride())))); }
From source file:net.myrrix.online.factorizer.als.AlternatingLeastSquaresTest.java
private static RealMatrix buildTestXYTProduct(boolean reconstructR) throws ExecutionException, InterruptedException { System.setProperty("model.reconstructRMatrix", Boolean.toString(reconstructR)); FastByIDMap<FastByIDFloatMap> byRow = new FastByIDMap<FastByIDFloatMap>(); FastByIDMap<FastByIDFloatMap> byCol = new FastByIDMap<FastByIDFloatMap>(); // Octave: R = [ 0 2 3 1 0 ; 0 0 4 5 0 ; 1 0 0 0 2 ; 3 0 1 0 5 ; 0 2 2 2 0 ] MatrixUtils.addTo(0, 1, 2.0f, byRow, byCol); MatrixUtils.addTo(0, 2, 3.0f, byRow, byCol); MatrixUtils.addTo(0, 3, 1.0f, byRow, byCol); MatrixUtils.addTo(1, 2, 4.0f, byRow, byCol); MatrixUtils.addTo(1, 3, 5.0f, byRow, byCol); MatrixUtils.addTo(2, 0, 1.0f, byRow, byCol); MatrixUtils.addTo(2, 4, 2.0f, byRow, byCol); MatrixUtils.addTo(3, 0, 3.0f, byRow, byCol); MatrixUtils.addTo(3, 2, 1.0f, byRow, byCol); MatrixUtils.addTo(3, 4, 5.0f, byRow, byCol); MatrixUtils.addTo(4, 1, 2.0f, byRow, byCol); MatrixUtils.addTo(4, 2, 2.0f, byRow, byCol); MatrixUtils.addTo(4, 3, 2.0f, byRow, byCol); // Octave: Y = [ 0.1 0.2 ; 0.2 0.5 ; 0.3 0.1 ; 0.2 0.2 ; 0.5 0.4 ]; FastByIDMap<float[]> previousY = new FastByIDMap<float[]>(); previousY.put(0L, new float[] { 0.1f, 0.2f }); previousY.put(1L, new float[] { 0.2f, 0.5f }); previousY.put(2L, new float[] { 0.3f, 0.1f }); previousY.put(3L, new float[] { 0.2f, 0.2f }); previousY.put(4L, new float[] { 0.5f, 0.4f }); MatrixFactorizer als = new AlternatingLeastSquares(byRow, byCol, 2, 0.0001, 40); als.setPreviousY(previousY);//from w ww . j a v a2s. c o m als.call(); RealMatrix product = MatrixUtils.multiplyXYT(als.getX(), als.getY()); StringBuilder productString = new StringBuilder(100); for (int row = 0; row < product.getRowDimension(); row++) { productString.append('\n').append(Arrays.toString(doubleToFloatArray(product.getRow(row)))); } log.info("{}", productString); return product; }
From source file:com.netflix.discovery.converters.jackson.serializer.InstanceInfoJsonBeanSerializer.java
@Override protected void serializeFields(Object bean, JsonGenerator jgen0, SerializerProvider provider) throws IOException { super.serializeFields(bean, jgen0, provider); InstanceInfo instanceInfo = (InstanceInfo) bean; jgen0.writeFieldName("port"); jgen0.writeStartObject();// ww w . j ava2 s .com jgen0.writeNumberField("$", instanceInfo.getPort()); jgen0.writeStringField("@enabled", Boolean.toString(instanceInfo.isPortEnabled(PortType.UNSECURE))); jgen0.writeEndObject(); jgen0.writeFieldName("securePort"); jgen0.writeStartObject(); jgen0.writeNumberField("$", instanceInfo.getSecurePort()); jgen0.writeStringField("@enabled", Boolean.toString(instanceInfo.isPortEnabled(PortType.SECURE))); jgen0.writeEndObject(); // Save @class field for backward compatibility. Remove once all clients are migrated to the new codec if (!compactMode) { jgen0.writeFieldName("metadata"); if (instanceInfo.getMetadata() == null || instanceInfo.getMetadata().isEmpty()) { stringMapObjectMapper.writeValue(jgen0, EMPTY_MAP); } else { stringMapObjectMapper.writeValue(jgen0, instanceInfo.getMetadata()); } } }
From source file:com.netflix.discovery.converters.jackson.serializer.InstanceInfoXmlBeanSerializer.java
@Override protected void serializeFields(Object bean, JsonGenerator jgen0, SerializerProvider provider) throws IOException { super.serializeFields(bean, jgen0, provider); InstanceInfo instanceInfo = (InstanceInfo) bean; ToXmlGenerator xgen = (ToXmlGenerator) jgen0; xgen.writeFieldName("port"); xgen.writeStartObject();/*from w w w . j a v a 2 s. c om*/ xgen.setNextIsAttribute(true); xgen.writeFieldName("enabled"); xgen.writeBoolean(instanceInfo.isPortEnabled(PortType.UNSECURE)); xgen.setNextIsAttribute(false); xgen.writeFieldName("port"); xgen.setNextIsUnwrapped(true); xgen.writeString(Integer.toString(instanceInfo.getPort())); xgen.writeEndObject(); xgen.writeFieldName("securePort"); xgen.writeStartObject(); xgen.setNextIsAttribute(true); xgen.writeStringField("enabled", Boolean.toString(instanceInfo.isPortEnabled(PortType.SECURE))); xgen.setNextIsAttribute(false); xgen.writeFieldName("securePort"); xgen.setNextIsUnwrapped(true); xgen.writeString(Integer.toString(instanceInfo.getSecurePort())); xgen.writeEndObject(); }
From source file:com.bluexml.side.framework.alfresco.commons.configurations.PropertiesConfiguration.java
public boolean getAsBooleanValue(String key, Boolean defaultValue) { String defaultString = Boolean.toString(defaultValue); String value = getValue(key, defaultString); return Boolean.parseBoolean(value.trim()); }
From source file:com.athina.queue.manager.quartz.QuartzProperties.java
public Properties buildQuartzProperties() { Properties props = new Properties(); //skip the check to don't bother with quartz updates props.setProperty(StdSchedulerFactory.PROP_SCHED_SKIP_UPDATE_CHECK, Boolean.toString(true)); props.setProperty(StdSchedulerFactory.PROP_SCHED_INSTANCE_ID, StdSchedulerFactory.AUTO_GENERATE_INSTANCE_ID); if (threadCount != null) { props.setProperty(SchedulerFactoryBean.PROP_THREAD_COUNT, threadCount.toString()); }//from w w w . j ava2s .c o m return props; }
From source file:edu.northwestern.bioinformatics.studycalendar.xml.writers.AmendmentXmlSerializer.java
public Element createElement(Amendment amendment) { Element element = null;//from ww w . j a va2 s . c o m if (!isDevelopmentAmendment) { element = XsdElement.AMENDMENT.create(); } else { element = XsdElement.DEVELOPMENT_AMENDMENT.create(); } element.addAttribute(NAME, amendment.getName()); element.addAttribute(DATE, formatter.format(amendment.getDate())); element.addAttribute(MANDATORY, Boolean.toString(amendment.isMandatory())); XsdAttribute.RELEASED_DATE.addToDateTime(element, amendment.getReleasedDate()); XsdAttribute.UPDATED_DATE.addToDateTime(element, amendment.getUpdatedDate()); if (amendment.getPreviousAmendment() != null) { element.addAttribute(PREVIOUS_AMENDMENT_KEY, amendment.getPreviousAmendment().getNaturalKey()); } addDeltas(amendment, element); return element; }
From source file:com.zotoh.core.util.JSONUte.java
/** * @param j/*www . j a v a2 s. c o m*/ * @param fld * @param b * @throws JSONException */ public static void addString(JSONObject j, String fld, Boolean b) throws JSONException { if (j != null && fld != null) { j.put(fld, Boolean.toString(b)); } }
From source file:com.photon.phresco.framework.impl.ConfigurationWriter.java
/** * creates the environment/* w w w .j av a2 s .co m*/ * @param selectedEnvs */ public void createEnvironment(List<Environment> envs) { for (Environment env : envs) { Element envNode = getDocument().createElement("environment"); envNode.setAttribute("name", env.getName()); envNode.setAttribute("desc", env.getDesc()); envNode.setAttribute("default", Boolean.toString(env.isDefaultEnv())); getRootElement().appendChild(envNode); } }