List of usage examples for java.lang Boolean Boolean
@Deprecated(since = "9") public Boolean(String s)
From source file:org.workin.http.httpclient.v4.handler.response.BooleanResponseHandler.java
@Override public Boolean handleResponse(HttpResponse response) throws ClientProtocolException, IOException { String result = super.doResponse(response); return result != null ? new Boolean(result) : new Boolean(super.getDefaultValue()); }
From source file:eu.freme.broker.integration_tests.IntegrationTestSetup.java
public static void setUp() { logger.info(//from w ww . j a va2 s . c om "\n-------------------------------------------------------\nSetup FREME Integration tests\n-------------------------------------------------------"); String str = System.getProperty("freme.test.startServer"); if (str == null) { startFreme = true; } else { startFreme = new Boolean(str).booleanValue(); } if (startFreme) { context = SpringApplication.run(IntegrationTestConfig.class, new String[] { "--spring.profiles.active=broker" }); } alreadySetup = true; logger.info( "\n-------------------------------------------------------\nSetup FREME Integration tests finished\n-------------------------------------------------------"); }
From source file:com.zjy.utils.propertyset.RuntimeCachingPropertySet.java
public void init() { PropertySetConfig psc = PropertySetConfig.getConfig(); Map<?, ?> cacheConfig = psc.getArgs("cached"); Map<String, Object> cacheArgs = new HashMap<String, Object>(); cacheArgs.put("PropertySet", rjps); cacheArgs.put("bulkload", new Boolean("true")); logger.info("init complete"); super.init(cacheConfig, cacheArgs); }
From source file:org.esupportail.sympa.test.IntroTest.java
public void testIntro() throws Exception { UserSympaList item = new UserSympaList(); item.setEditor(true);//from w w w . java 2s. c om item.setOwner(false); item.setSubscriber(true); List<SympaListCriterion> crit = new ArrayList<SympaListCriterion>(); crit.add(new SympaListCriterion(SympaListFields.editor, new Boolean(true))); crit.add(new SympaListCriterion(SympaListFields.owner, new Boolean(true))); crit.add(new SympaListCriterion(SympaListFields.subscriber, new Boolean(true))); DirectFieldAccessor accessor = new DirectFieldAccessor(item); System.out.println(accessor.getPropertyValue("editor").equals(new Boolean(false))); System.out.println(matchCriterion(item, crit)); }
From source file:jGW2API.util.item.Bag.java
public Bag(JSONObject json) { super(json);// w w w .j a va 2 s .c o m JSONObject bag = json.getJSONObject("bag"); this.noSellOrSort = new Boolean(bag.getString("no_sell_or_sort")); this.size = new Integer(bag.getString("size")); }
From source file:io.seldon.api.service.ABTestingServer.java
public static CFAlgorithm getUserTest(String consumer, String recTag, String clientUserId) { CFAlgorithm res = null;/*www .jav a 2s.c om*/ final String abTestKey = getABTestKey(consumer, recTag); ABTest abTest = tests.get(abTestKey); if (abTest != null) { String mKey = MemCacheKeys.getABTestingUser(abTestKey, clientUserId, abTest.getAlgorithm().getAbTestingKey()); Boolean inTest = (Boolean) MemCachePeer.get(mKey); if (inTest == null) { // decide whether this user should be in test and store in memcache if (Math.random() <= abTest.getPercentage()) { MemCachePeer.put(mKey, new Boolean(true), CACHING_TIME); res = abTest.getAlgorithm(); } else { //Store the fact this user is not in the test MemCachePeer.put(mKey, new Boolean(false), CACHING_TIME); } } else if (inTest) { res = abTest.getAlgorithm(); } } return res; }
From source file:com.icesoft.faces.util.CoreUtils.java
public static boolean isPortletEnvironment() { if (portletEnvironment == null) { try {// ww w . j av a 2 s . com Class portletRequestClass = Class.forName("javax.portlet.PortletRequest"); portletEnvironment = new Boolean(portletRequestClass .isInstance(FacesContext.getCurrentInstance().getExternalContext().getRequest())); } catch (Throwable e) { //both ClassNotFoundException and NoClassDefError //portlet not found portletEnvironment = Boolean.FALSE; } } return portletEnvironment.booleanValue(); }
From source file:FileTree2.java
public FileTree2() { super("Directories Tree [Popup Menus]"); setSize(400, 300);/*from w ww. j a va2s . c o m*/ DefaultMutableTreeNode top = new DefaultMutableTreeNode(new IconData(ICON_COMPUTER, null, "Computer")); DefaultMutableTreeNode node; File[] roots = File.listRoots(); for (int k = 0; k < roots.length; k++) { node = new DefaultMutableTreeNode(new IconData(ICON_DISK, null, new FileNode(roots[k]))); top.add(node); node.add(new DefaultMutableTreeNode(new Boolean(true))); } m_model = new DefaultTreeModel(top); m_tree = new JTree(m_model); m_tree.putClientProperty("JTree.lineStyle", "Angled"); TreeCellRenderer renderer = new IconCellRenderer(); m_tree.setCellRenderer(renderer); m_tree.addTreeExpansionListener(new DirExpansionListener()); m_tree.addTreeSelectionListener(new DirSelectionListener()); m_tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); m_tree.setShowsRootHandles(true); m_tree.setEditable(false); JScrollPane s = new JScrollPane(); s.getViewport().add(m_tree); getContentPane().add(s, BorderLayout.CENTER); m_display = new JTextField(); m_display.setEditable(false); getContentPane().add(m_display, BorderLayout.NORTH); // NEW m_popup = new JPopupMenu(); m_action = new AbstractAction() { public void actionPerformed(ActionEvent e) { if (m_clickedPath == null) return; if (m_tree.isExpanded(m_clickedPath)) m_tree.collapsePath(m_clickedPath); else m_tree.expandPath(m_clickedPath); } }; m_popup.add(m_action); m_popup.addSeparator(); Action a1 = new AbstractAction("Delete") { public void actionPerformed(ActionEvent e) { m_tree.repaint(); JOptionPane.showMessageDialog(FileTree2.this, "Delete option is not implemented", "Info", JOptionPane.INFORMATION_MESSAGE); } }; m_popup.add(a1); Action a2 = new AbstractAction("Rename") { public void actionPerformed(ActionEvent e) { m_tree.repaint(); JOptionPane.showMessageDialog(FileTree2.this, "Rename option is not implemented", "Info", JOptionPane.INFORMATION_MESSAGE); } }; m_popup.add(a2); m_tree.add(m_popup); m_tree.addMouseListener(new PopupTrigger()); WindowListener wndCloser = new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }; addWindowListener(wndCloser); setVisible(true); }
From source file:FileTree3.java
public FileTree3() { super("Directories Tree [Tool Tips]"); setSize(400, 300);/*from ww w . j a v a 2s. c o m*/ DefaultMutableTreeNode top = new DefaultMutableTreeNode(new IconData(ICON_COMPUTER, null, "Computer")); DefaultMutableTreeNode node; File[] roots = File.listRoots(); for (int k = 0; k < roots.length; k++) { node = new DefaultMutableTreeNode(new IconData(ICON_DISK, null, new FileNode(roots[k]))); top.add(node); node.add(new DefaultMutableTreeNode(new Boolean(true))); } m_model = new DefaultTreeModel(top); // NEW m_tree = new JTree(m_model) { public String getToolTipText(MouseEvent ev) { if (ev == null) return null; TreePath path = m_tree.getPathForLocation(ev.getX(), ev.getY()); if (path != null) { FileNode fnode = getFileNode(getTreeNode(path)); if (fnode == null) return null; File f = fnode.getFile(); return (f == null ? null : f.getPath()); } return null; } }; ToolTipManager.sharedInstance().registerComponent(m_tree); m_tree.putClientProperty("JTree.lineStyle", "Angled"); TreeCellRenderer renderer = new IconCellRenderer(); m_tree.setCellRenderer(renderer); m_tree.addTreeExpansionListener(new DirExpansionListener()); m_tree.addTreeSelectionListener(new DirSelectionListener()); m_tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); m_tree.setShowsRootHandles(true); m_tree.setEditable(false); JScrollPane s = new JScrollPane(); s.getViewport().add(m_tree); getContentPane().add(s, BorderLayout.CENTER); m_display = new JTextField(); m_display.setEditable(false); getContentPane().add(m_display, BorderLayout.NORTH); m_popup = new JPopupMenu(); m_action = new AbstractAction() { public void actionPerformed(ActionEvent e) { if (m_clickedPath == null) return; if (m_tree.isExpanded(m_clickedPath)) m_tree.collapsePath(m_clickedPath); else m_tree.expandPath(m_clickedPath); } }; m_popup.add(m_action); m_popup.addSeparator(); Action a1 = new AbstractAction("Delete") { public void actionPerformed(ActionEvent e) { m_tree.repaint(); JOptionPane.showMessageDialog(FileTree3.this, "Delete option is not implemented", "Info", JOptionPane.INFORMATION_MESSAGE); } }; m_popup.add(a1); Action a2 = new AbstractAction("Rename") { public void actionPerformed(ActionEvent e) { m_tree.repaint(); JOptionPane.showMessageDialog(FileTree3.this, "Rename option is not implemented", "Info", JOptionPane.INFORMATION_MESSAGE); } }; m_popup.add(a2); m_tree.add(m_popup); m_tree.addMouseListener(new PopupTrigger()); WindowListener wndCloser = new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }; addWindowListener(wndCloser); setVisible(true); }
From source file:cn.itcast.fredck.FCKeditor.uploader.SimpleUploaderServlet.java
/** * Initialize the servlet.<br>/*from ww w .j av a 2 s . co m*/ * Retrieve from the servlet configuration the "baseDir" which is the root of the file repository:<br> * If not specified the value of "/UserFiles/" will be used.<br> * Also it retrieve all allowed and denied extensions to be handled. * */ @Override public void init() throws ServletException { debug = (new Boolean(getInitParameter("debug"))).booleanValue(); if (debug) System.out.println("\r\n---- SimpleUploaderServlet initialization started ----"); baseDir = getInitParameter("baseDir"); enabled = (new Boolean(getInitParameter("enabled"))).booleanValue(); if (baseDir == null) baseDir = "/UserFiles/"; String realBaseDir = getServletContext().getRealPath(baseDir); File baseFile = new File(realBaseDir); if (!baseFile.exists()) { baseFile.mkdir(); } allowedExtensions = new Hashtable(3); deniedExtensions = new Hashtable(3); allowedExtensions.put("File", stringToArrayList(getInitParameter("AllowedExtensionsFile"))); deniedExtensions.put("File", stringToArrayList(getInitParameter("DeniedExtensionsFile"))); allowedExtensions.put("Image", stringToArrayList(getInitParameter("AllowedExtensionsImage"))); deniedExtensions.put("Image", stringToArrayList(getInitParameter("DeniedExtensionsImage"))); allowedExtensions.put("Flash", stringToArrayList(getInitParameter("AllowedExtensionsFlash"))); deniedExtensions.put("Flash", stringToArrayList(getInitParameter("DeniedExtensionsFlash"))); if (debug) System.out.println("---- SimpleUploaderServlet initialization completed ----\r\n"); }