List of usage examples for java.lang Boolean valueOf
public static Boolean valueOf(String s)
From source file:com.adaptris.security.certificate.X509Handler.java
/** Default constructor */ private X509Handler() { SecurityUtil.addProvider();/*from w w w . j av a2 s.c o m*/ revocationService = RevocationService.getDefaultInstance(); checkRevocation = !Boolean.valueOf(System.getProperty(Constants.IGNORE_REV, "false")).booleanValue(); }
From source file:org.wicketstuff.gmap.api.GLatLng.java
public String getArguments() { return new StringBuilder().append(BigDecimal.valueOf(lat).toString()).append(",") .append(BigDecimal.valueOf(lng).toString()).append(",").append(Boolean.valueOf(unbounded)) .toString();//from w w w . j a v a 2 s . c o m }
From source file:pl.bristleback.server.bristle.conf.namespace.BristlebackStandaloneServerBeanDefinitionParser.java
@Override protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { boolean startAfterInit = Boolean.valueOf(element.getAttribute("startAfterInit")); String configurationResolver = element.getAttribute("configurationResolver"); builder.addPropertyReference("initialConfigurationResolver", configurationResolver); if (startAfterInit) { builder.setInitMethodName("startServer"); }/* w ww . j a v a 2 s . c o m*/ }
From source file:com.amazonaws.hal.client.HalJsonLinkUnmarshaller.java
@Override public HalLink unmarshall(JsonUnmarshallerContext context) throws Exception { HalLink halLink = new HalLink(); JsonToken token = context.getCurrentToken(); while (token != null && token != JsonToken.END_OBJECT) { if (token == JsonToken.FIELD_NAME) { if (context.testExpression("href")) { context.nextToken();/* w w w. j a v a 2 s . c om*/ halLink.setHref(context.readText()); } else if (context.testExpression("name")) { context.nextToken(); halLink.setName(context.readText()); } else if (context.testExpression("title")) { context.nextToken(); halLink.setTitle(context.readText()); } else if (context.testExpression("templated")) { context.nextToken(); halLink.setTemplated(Boolean.valueOf(context.readText())); } else if (context.testExpression("deprecation")) { context.nextToken(); halLink.setDeprecation(context.readText()); } else { // Ignore this. Likely one of hreflang, profile, type context.nextToken(); } } token = context.nextToken(); } return halLink; }
From source file:org.wuspba.ctams.ui.server.DataUtils.java
protected static CTAMSDocument getBand(HttpServletRequest request) { Band band = new Band(); band.setId(request.getParameter("id")); band.setName(request.getParameter("name")); band.setAddress(request.getParameter("address")); band.setCity(request.getParameter("city")); band.setState(request.getParameter("state")); band.setZip(request.getParameter("zip")); band.setCountry(request.getParameter("country")); band.setTelephone(request.getParameter("telephone")); band.setUrl(request.getParameter("url")); band.setEmail(request.getParameter("email")); band.setGrade(Grade.valueOf(request.getParameter("grade"))); band.setBranch(Branch.valueOf(request.getParameter("branch"))); band.setType(BandType.valueOf(request.getParameter("type"))); band.setDissolved(Boolean.valueOf(request.getParameter("dissolved"))); CTAMSDocument doc = new CTAMSDocument(); doc.getBands().add(band);//from ww w . j a v a2 s .c o m return doc; }
From source file:dias.DIAS.java
public static boolean configureSession() { boolean output = false; //be pessimistic. Configurations configs = new Configurations(); try {//from w w w. ja v a2s . c o m XMLConfiguration config = configs.xml("config/configuration.xml"); //this is a really nice factory implementation we're eliding //use XPATH so we can query attributes. NB that this means we'll be using slash-style lookup as in // "processing/paths/excelFilePath" // instead of // "processing.paths.excelFilePath" config.setExpressionEngine(new XPathExpressionEngine()); configurationEnvironment = config.getString("environment/env"); verboseMode = Boolean.valueOf(config.getString("environment/verbose")); if (verboseMode) { System.out.println("User directory is " + System.getProperty("user.dir")); } if (verboseMode) { System.out.println(configurationEnvironment); } excelFilePath = config .getString("processing[@env='" + configurationEnvironment + "']/paths/excelFilePath"); bodymediaFileUrl = config .getString("processing[@env='" + configurationEnvironment + "']/paths/bodymediaFileUrl"); //HierarchicalConfiguration node = (HierarchicalConfiguration) config.configurationAt("/nodes/node[@id='"+(str)+"']"); List<String> emails = config.getList(String.class, "processing[@env='" + configurationEnvironment + "']/emails/email"); privateMails = new String[emails.size()]; privateMails = emails.toArray(privateMails); output = true; } catch (ConfigurationException cex) { //Something went wrong; we should probably check to see if the configuration file wasn't found, // but otherwise just keep the output as false. System.out.println(cex.getMessage()); } return output; }
From source file:com.webtide.jetty.load.generator.web.MonitorServlet.java
@Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { if (_restrictToLocalhost) { if (!isLoopbackAddress(req.getRemoteAddr())) { resp.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE); return; }//from w ww.j a va 2s .c o m } if (Boolean.valueOf(req.getParameter("start"))) { start = platformMonitor.start(); return; } if (Boolean.valueOf(req.getParameter("stop"))) { stop = platformMonitor.stop(); return; } if (Boolean.valueOf(req.getParameter("stats"))) { if (start == null) { resp.sendError(HttpServletResponse.SC_BAD_REQUEST); return; } if (stop == null) { stop = platformMonitor.stop(); } sendResponse(resp); } }
From source file:io.github.swagger2markup.internal.adapter.PropertyAdapter.java
/** * Convert a string {@code value} to specified {@code type}. * * @param value value to convert/*from w w w. java2 s. c om*/ * @param type target conversion type * @return converted value as object */ public static Object convertExample(String value, String type) { if (value == null) { return null; } try { switch (type) { case "integer": return Integer.valueOf(value); case "number": return Float.valueOf(value); case "boolean": return Boolean.valueOf(value); case "string": return value; default: return value; } } catch (NumberFormatException e) { throw new RuntimeException(String.format("Value '%s' cannot be converted to '%s'", value, type), e); } }
From source file:co.com.soinsoftware.altablero.controller.NoteDefinitionController.java
private NoteDefinitionBO buildNoteDefinitionFromString(final int idClass, final int idPeriod, final String objectStr) { NoteDefinitionBO noteDefinition = null; final String[] properties = objectStr.split(";"); int idNoteDefinition = 0; String name = null;// w w w . java 2s.c o m String description = null; int value = 0; boolean enabled = false; for (int i = 0; i < properties.length; i++) { final String[] property = properties[i].split("="); switch (property[0]) { case "idNoteDefinition": idNoteDefinition = Integer.valueOf(property[1]); break; case "name": name = property[1]; break; case "description": description = property[1]; break; case "value": value = Integer.valueOf(property[1].replace("_", "")); break; case "enabled": enabled = Boolean.valueOf(property[1]); break; } if (name != null && description != null && value > 0) { noteDefinition = new NoteDefinitionBO(idNoteDefinition, name, description, value, enabled, idClass, idPeriod); } } return noteDefinition; }
From source file:gobblin.data.management.retention.action.RetentionAction.java
public RetentionAction(Config actionConfig, FileSystem fs, Config jobConfig) { this.versionSelectionAliasResolver = new ClassAliasResolver<>(VersionSelectionPolicy.class); this.fs = fs; this.isSimulateMode = ConfigUtils.getBoolean(jobConfig, FsCleanableHelper.SIMULATE_KEY, Boolean.valueOf(FsCleanableHelper.SIMULATE_DEFAULT)); }