List of usage examples for java.lang Boolean Boolean
@Deprecated(since = "9") public Boolean(String s)
From source file:com.github.xbn.array.helper.BooleanArrayHelper.java
/** * @return <code>(new Boolean({@link #getPrimitiveArray(Object, NullContainer, String) getPrimitiveArray}(obj_thatIsPrimArr, NullContainer.{@link com.github.xbn.array.NullContainer#BAD BAD}, array_name)[index]))</code> *//*w ww . j av a 2 s .co m*/ public Boolean getWrapper(Object obj_thatIsPrimArr, int index, String array_name) { try { return (new Boolean(getPrimitiveArray(obj_thatIsPrimArr, NullContainer.BAD, array_name)[index])); } catch (RuntimeException rx) { ciObjNullUnexpectedTypeOrBadIndex(obj_thatIsPrimArr, index, array_name); throw rx; } }
From source file:org.openmeetings.app.remote.red5.ClientListManager.java
public synchronized RoomClient addClientListItem(String streamId, String scopeName, Integer remotePort, String remoteAddress, String swfUrl, boolean isAVClient) { try {/* w ww.j a va2 s . co m*/ // Store the Connection into a bean and add it to the HashMap RoomClient rcm = new RoomClient(); rcm.setConnectedSince(new Date()); rcm.setStreamid(streamId); rcm.setScope(scopeName); long thistime = new Date().getTime(); rcm.setPublicSID( manageCryptStyle.getInstanceOfCrypt().createPassPhrase(String.valueOf(thistime).toString())); rcm.setUserport(remotePort); rcm.setUserip(remoteAddress); rcm.setSwfurl(swfUrl); rcm.setIsMod(new Boolean(false)); rcm.setCanDraw(new Boolean(false)); rcm.setIsAVClient(isAVClient); if (clientList.containsKey(streamId)) { log.error("Tried to add an existing Client " + streamId); return null; } clientList.put(rcm.getStreamid(), rcm); log.debug(" :: addClientListItem :: " + rcm.getRoomClientId()); return rcm; } catch (Exception err) { log.error("[addClientListItem]", err); } return null; }
From source file:com.adito.agent.client.standalone.StandaloneGUI.java
public boolean promptForCredentials(final boolean proxy, final HttpAuthenticator authenticator) { return ((Boolean) SWTRunner.syncExec(getDisplay(), new SWTRunner() { public Object doRun() { return new Boolean(SWTAuthenticationDialog.promptForCredentials(proxy, getShell(), authenticator, proxy ? null : authImage)); }//w ww . j av a2 s .co m })).booleanValue(); }
From source file:course.quiz.item.GenItem.java
/** * Sets correct.//w ww. j av a 2s .c om * * @param correct * correct */ public void setCorrect(boolean correct) { setCorrect(new Boolean(correct)); }
From source file:com.silverpeas.tags.navigation.MenuTag.java
/** * Prfixe la classe css par "selected" de l'item selectionn et eventuellement de ses items * parents./*from www.j a va2s . c o m*/ * @param hierarchicSelection */ public void setHierarchicSelection(String hierarchicSelection) { this.hierarchicSelection = new Boolean(hierarchicSelection); }
From source file:nz.co.senanque.validationengine.ConvertUtils.java
public static Object convertToObject(Class<?> clazz) { if (clazz.isPrimitive()) { if (clazz.equals(Long.TYPE)) { return new Long(0L); } else if (clazz.equals(Integer.TYPE)) { return new Integer(0); } else if (clazz.equals(Float.TYPE)) { return new Float(0F); } else if (clazz.equals(Double.TYPE)) { return new Double(0D); } else if (clazz.equals(Boolean.TYPE)) { return new Boolean(false); }// ww w . j a v a2s .com } return null; }
From source file:userinterface.graph.AxisSettingsHistogram.java
/** * Initializes all the settings/*w w w. j a va2 s . co m*/ */ public void init() { heading = new SingleLineStringSetting("heading", name, "The heading for this axis", this, true); headingFont = new FontColorSetting("heading font", new FontColorPair(new Font("SansSerif", Font.PLAIN, 12), Color.black), "The font for this axis' heading.", this, true); numberFont = new FontColorSetting("numbering font", new FontColorPair(new Font("SansSerif", Font.PLAIN, 12), Color.black), "The font used to number the axis.", this, true); showGrid = new BooleanSetting("show gridlines", new Boolean(true), "Should the gridlines be visible", this, true); gridColour = new ColorSetting("gridline colour", new Color(204, 204, 204), "The colour of the gridlines", this, true); updateAxis(); }
From source file:org.openmrs.module.rwandaprimarycare.EnterSimpleEncounterController.java
@RequestMapping(method = RequestMethod.GET, params = "form=vitals") public String setupVitalsForm(@RequestParam("patientId") Integer patientId, @RequestParam(required = false, value = "visitDate") Long visitDate, ModelMap model) throws PrimaryCareException { //LK: Need to ensure that all primary care methods only throw a PrimaryCareException //So that errors will be directed to a touch screen error page try {/* w w w. j ava 2 s.c om*/ Patient patient = getPatient(patientId); model.addAttribute(patient); model.addAttribute("encounterType", PrimaryCareConstants.ENCOUNTER_TYPE_VITALS); List<Question> questions = new ArrayList<Question>(); MessageSourceAccessor msa = new MessageSourceAccessor( Context.getMessageSourceService().getActiveMessageSource()); questions.add(new Question(msa.getMessage("rwandaprimarycare.temperature"), PrimaryCareBusinessLogic.getTemperatureConcept(), false)); questions.add(new Question(msa.getMessage("rwandaprimarycare.weight"), PrimaryCareBusinessLogic.getWeightConcept(), true)); StringBuilder heightMsg = new StringBuilder(msa.getMessage("rwandaprimarycare.height")); //LK: if the BMI automatic calculation functionality is turned on we want to display //the last entered height and approximate age so the clerk can determine if remeasuring the patient is required Boolean calculateBMI = new Boolean( Context.getAdministrationService().getGlobalProperty("registration.calculateBMI")); if (calculateBMI) { Obs mostRecentHeightOb = PrimaryCareUtil.getMostRecentHeightObservation(patient); if (mostRecentHeightOb != null) { heightMsg = heightMsg.append(". ") .append(msa.getMessage("rwandaprimarycare.lastRecordedHeight")).append(": ") .append(mostRecentHeightOb.getValueAsString(Context.getLocale())); heightMsg = heightMsg.append(" ") .append(msa.getMessage("rwandaprimarycare.lastRecordedHeightAge")).append(": ") .append(PrimaryCareUtil.getAgeAtObservation(patient, mostRecentHeightOb)); } } questions.add(new Question(heightMsg.toString(), PrimaryCareBusinessLogic.getHeightConcept(), false)); model.addAttribute("questions", questions); if (visitDate != null) { model.addAttribute("visitDate", visitDate); } } catch (Exception e) { throw new PrimaryCareException(e); } return "/module/rwandaprimarycare/enterSimpleEncounter"; }
From source file:org.dspace.app.webui.cris.controller.ProjectDetailsController.java
@Override public ModelAndView handleDetails(HttpServletRequest request, HttpServletResponse response) throws Exception { Map<String, Object> model = new HashMap<String, Object>(); Project grant = extractProject(request); if (grant == null) { response.sendError(HttpServletResponse.SC_NOT_FOUND, "Grant page not found"); return null; }//from w w w . jav a 2 s . com Context context = UIUtil.obtainContext(request); EPerson currentUser = context.getCurrentUser(); if ((grant.getStatus() == null || grant.getStatus().booleanValue() == false) && !AuthorizeManager.isAdmin(context)) { if (currentUser != null || Authenticate.startAuthentication(context, request, response)) { // Log the error log.info(LogManager.getHeader(context, "authorize_error", "Only system administrator can access to disabled researcher page")); JSPManager.showAuthorizeError(request, response, new AuthorizeException("Only system administrator can access to disabled researcher page")); } return null; } if (AuthorizeManager.isAdmin(context)) { model.put("grant_page_menu", new Boolean(true)); } ModelAndView mvc = null; try { mvc = super.handleDetails(request, response); } catch (RuntimeException e) { return null; } if (subscribeService != null) { boolean subscribed = subscribeService.isSubscribed(currentUser, grant); model.put("subscribed", subscribed); } request.setAttribute("sectionid", StatsConfig.DETAILS_SECTION); new DSpace().getEventService().fireEvent(new UsageEvent(UsageEvent.Action.VIEW, request, context, grant)); mvc.getModel().putAll(model); mvc.getModel().put("project", grant); return mvc; }
From source file:com.google.feedserver.util.CommonsCliHelper.java
/** * Loop through each registered class and parse the command line for their * flags. If option isnt specified we leave the default. *///from w ww.j a v a 2s. c om @SuppressWarnings("unchecked") private void populateClasses() { for (Class flagClass : classes) { for (Field field : flagClass.getFields()) { if (field.getName().endsWith("_FLAG")) { String argName = field.getName().substring(0, field.getName().length() - "_FLAG".length()); if (field.getType().getName().equals(Boolean.class.getName())) { if (flags.hasOption(argName)) { setField(field, new Boolean(true)); } else if (flags.hasOption("no" + argName)) { setField(field, new Boolean(false)); } } else { String argValue = flags.getOptionValue(argName, null); if (argValue != null) { setField(field, argValue); } } } } } }