Example usage for java.lang Boolean Boolean

List of usage examples for java.lang Boolean Boolean

Introduction

In this page you can find the example usage for java.lang Boolean Boolean.

Prototype

@Deprecated(since = "9")
public Boolean(String s) 

Source Link

Document

Allocates a Boolean object representing the value true if the string argument is not null and is equal, ignoring case, to the string "true" .

Usage

From source file:Contract.AbstractContract.java

@Override
public JSONObject getJSONObject() {
    JSONObject obj = new JSONObject();
    JSONArray list = new JSONArray();
    for (Iterator<AbstractPayment> it = this.payments.iterator(); it.hasNext();) {
        AbstractPayment ap = it.next();/*from w  w  w .  j av a  2s  . c om*/
        list.add(ap.getJSONObject());
    }
    obj.put("payments", list);
    obj.put("id", this.getContractUniqueId());
    obj.put("workPlace", this.workPlace);
    obj.put("post", this.post);
    obj.put("validDate", this.validDate);
    obj.put("forever", new Boolean(this.forever));

    return obj;

}

From source file:com.autentia.tnt.manager.billing.BillManager.java

public List<BillBreakDown> getAllBitacoreBreakDowns(Date start, Date end, Project project) {

    final List<BillBreakDown> desgloses = new ArrayList<BillBreakDown>();

    ActivityDAO activityDAO = ActivityDAO.getDefault();
    ActivitySearch actSearch = new ActivitySearch();
    actSearch.setBillable(new Boolean(true));
    actSearch.setStartStartDate(start);/*from   ww  w .java 2 s  .c o  m*/
    actSearch.setEndStartDate(end);

    List<Activity> actividadesTotal = new ArrayList<Activity>();
    Hashtable user_roles = new Hashtable();

    ProjectRoleDAO projectRoleDAO = ProjectRoleDAO.getDefault();
    ProjectRoleSearch prjRolSearch = new ProjectRoleSearch();
    prjRolSearch.setProject(project);
    List<ProjectRole> roles = projectRoleDAO.search(prjRolSearch, new SortCriteria("id", false));
    for (ProjectRole proyRole : roles) {
        actSearch.setRole(proyRole);
        List<Activity> actividades = activityDAO.search(actSearch, new SortCriteria("startDate", false));
        actividadesTotal.addAll(actividades);
    }

    for (Activity act : actividadesTotal) {
        String key = act.getRole().getId().toString() + act.getUser().getId().toString();

        if (!user_roles.containsKey(key)) {
            Hashtable value = new Hashtable();
            value.put("ROLE", act.getRole());
            value.put("USER", act.getUser());
            user_roles.put(key, value);
        }
    }

    Enumeration en = user_roles.keys();

    while (en.hasMoreElements()) {
        String key = (String) en.nextElement();
        Hashtable pair = (Hashtable) user_roles.get(key);
        actSearch.setBillable(new Boolean(true));
        actSearch.setStartStartDate(start);
        actSearch.setEndStartDate(end);

        ProjectRole pR = (ProjectRole) pair.get("ROLE");
        User u = (User) pair.get("USER");
        actSearch.setRole(pR);
        actSearch.setUser(u);
        List<Activity> actividadesUsuarioRol = activityDAO.search(actSearch,
                new SortCriteria("startDate", false));

        BillBreakDown brd = new BillBreakDown();
        brd.setConcept("Imputaciones (usuario - rol): " + u.getName() + " - " + pR.getName());
        brd.setAmount(pR.getCostPerHour());

        IvaApplicator.applyIvaToTaxableObject(start, brd);

        BigDecimal unitsTotal = new BigDecimal(0);
        for (Activity act : actividadesUsuarioRol) {
            BigDecimal unitsActual = new BigDecimal(act.getDuration());
            unitsActual = unitsActual.divide(new BigDecimal(60), 2, RoundingMode.HALF_UP);
            unitsTotal = unitsTotal.add(unitsActual);
        }
        brd.setUnits(unitsTotal);
        brd.setSelected(true);
        desgloses.add(brd);
    }

    ProjectCostDAO prjCostDAO = ProjectCostDAO.getDefault();
    ProjectCostSearch prjCostSearch = new ProjectCostSearch();
    prjCostSearch.setProject(project);
    List<ProjectCost> costes = prjCostDAO.search(prjCostSearch, new SortCriteria("id", false));
    for (ProjectCost proyCost : costes) {
        BillBreakDown brd = new BillBreakDown();
        brd.setConcept("Coste: " + proyCost.getName());
        brd.setUnits(new BigDecimal(1));
        brd.setAmount(proyCost.getCost());

        IvaApplicator.applyIvaToTaxableObject(start, brd);

        brd.setSelected(true);
        desgloses.add(brd);
    }

    return desgloses;

}

From source file:podd.search.web.SearchCriteriaWeb.java

public Boolean getScopeMyProjects() {
    Boolean scopeMyProjects = Boolean.FALSE;
    if (strScopeMyProjects != null && authenticatedUser != null) {

        // Use utility to convert checkbox to boolean         
        scopeMyProjects = new Boolean(strScopeMyProjects);
    }//w w w . java  2  s .c o  m
    return scopeMyProjects;
}

From source file:net.sf.joost.trax.TransformerFactoryImpl.java

/**
 * Allows the user to retrieve specific attributes of the underlying
 * implementation./*ww  w. j  a  va2s  .  c  o  m*/
 * @param name The attribute name.
 * @return An object according to the attribute-name
 * @throws IllegalArgumentException When such a attribute does not exists.
 */
public Object getAttribute(String name) throws IllegalArgumentException {

    if (KEY_TH_RESOLVER.equals(name)) {
        return thResolver;
    } else if (KEY_OUTPUT_URI_RESOLVER.equals(name)) {
        return outputUriResolver;
    } else if (MESSAGE_EMITTER_CLASS.equals(name)) {
        return msgEmitter;
    } else if (KEY_XSLT_FACTORY.equals(name)) {
        return System.getProperty(KEY_XSLT_FACTORY);
    } else if (ALLOW_EXTERNAL_FUNCTIONS.equals(name)) {
        return new Boolean(allowExternalFunctions);
    } else if (DEBUG_FEATURE.equals(name)) {
        return new Boolean(debugmode);
    } else {
        if (log != null)
            log.warn("Feature not supported: " + name);
        throw new IllegalArgumentException("Feature not supported: " + name);
    }
}

From source file:com.duroty.application.admin.utils.AdminDefaultAction.java

/**
 * DOCUMENT ME!/*from  w  ww  . j  a  va2 s.c o  m*/
 *
 * @param request DOCUMENT ME!
 *
 * @return DOCUMENT ME!
 *
 * @throws NamingException DOCUMENT ME!
 * @throws RemoteException DOCUMENT ME!
 * @throws CreateException DOCUMENT ME!
 */
protected Send getSendInstance(HttpServletRequest request)
        throws NamingException, RemoteException, CreateException {
    SendHome home = null;

    Boolean localServer = new Boolean(Configuration.properties.getProperty(Configuration.LOCAL_WEB_SERVER));

    if (localServer.booleanValue()) {
        home = SendUtil.getHome();
    } else {
        Hashtable environment = getContextProperties(request);
        home = SendUtil.getHome(environment);
    }

    return home.create();
}

From source file:hermes.providers.messages.MapMessageImpl.java

public void setBoolean(String arg0, boolean arg1) throws JMSException {
    body.put(arg0, new Boolean(arg1));
}

From source file:com.xpn.xwiki.plugin.charts.params.DefaultChartParams2.java

void setAxis(String prefix) throws ParamException {
    set(prefix + AXIS_VISIBLE_SUFIX, Axis.DEFAULT_AXIS_VISIBLE);

    set(prefix + AXIS_LINE_VISIBLE_SUFFIX, Boolean.TRUE);
    set(prefix + AXIS_LINE_COLOR_SUFFIX, Axis.DEFAULT_AXIS_LINE_PAINT);
    set(prefix + AXIS_LINE_STROKE_SUFFIX, Axis.DEFAULT_AXIS_LINE_STROKE);

    set(prefix + AXIS_LABEL_SUFFIX, ""); // ?
    set(prefix + AXIS_LABEL_FONT_SUFFIX, Axis.DEFAULT_AXIS_LABEL_FONT);
    set(prefix + AXIS_LABEL_COLOR_SUFFIX, Axis.DEFAULT_AXIS_LABEL_PAINT);
    set(prefix + AXIS_LABEL_INSERTS_SUFFIX, Axis.DEFAULT_AXIS_LABEL_INSETS);

    set(prefix + AXIS_TICK_LABEL_VISIBLE_SUFFIX, new Boolean(Axis.DEFAULT_TICK_LABELS_VISIBLE));
    set(prefix + AXIS_TICK_LABEL_FONT_SUFFIX, Axis.DEFAULT_TICK_LABEL_FONT);
    set(prefix + AXIS_TICK_LABEL_COLOR_SUFFIX, Axis.DEFAULT_TICK_LABEL_PAINT);
    set(prefix + AXIS_TICK_LABEL_INSERTS_SUFFIX, Axis.DEFAULT_TICK_LABEL_INSETS);

    set(prefix + AXIS_TICK_MARK_VISIBLE_SUFFIX, new Boolean(Axis.DEFAULT_TICK_MARKS_VISIBLE));
    set(prefix + AXIS_TICK_MARK_INSIDE_LENGTH_SUFFIX, new Float(Axis.DEFAULT_TICK_MARK_INSIDE_LENGTH));
    set(prefix + AXIS_TICK_MARK_OUTSIDE_LENGTH_SUFFIX, new Float(Axis.DEFAULT_TICK_MARK_OUTSIDE_LENGTH));
    set(prefix + AXIS_TICK_MARK_COLOR_SUFFIX, Axis.DEFAULT_TICK_MARK_PAINT);
    set(prefix + AXIS_TICK_MARK_STROKE_SUFFIX, Axis.DEFAULT_TICK_MARK_STROKE);

    set(prefix + PLOTXY_AXIS_GRIDLINE_VISIBLE_SUFFIX, Boolean.TRUE);
    set(prefix + PLOTXY_AXIS_GRIDLINE_COLOR_SUFFIX, XYPlot.DEFAULT_GRIDLINE_PAINT);
    set(prefix + PLOTXY_AXIS_GRIDLINE_STROKE_SUFFIX, XYPlot.DEFAULT_GRIDLINE_STROKE);

    set(prefix + VALUE_AXIS_AUTO_RANGE_SUFFIX, new Boolean(ValueAxis.DEFAULT_AUTO_RANGE));
    set(prefix + VALUE_AXIS_AUTO_RANGE_MIN_SIZE_SUFFIX, new Double(ValueAxis.DEFAULT_AUTO_RANGE_MINIMUM_SIZE));
    set(prefix + VALUE_AXIS_AUTO_TICK_UNIT_SUFFIX, new Boolean(ValueAxis.DEFAULT_AUTO_TICK_UNIT_SELECTION));
    set(prefix + VALUE_AXIS_LOWER_BOUND_SUFFIX, new Double(ValueAxis.DEFAULT_LOWER_BOUND));
    set(prefix + VALUE_AXIS_UPPER_BOUND_SUFFIX, new Double(ValueAxis.DEFAULT_UPPER_BOUND));
    set(prefix + AXIS_LOWER_MARGIN_SUFFIX, new Double(ValueAxis.DEFAULT_LOWER_MARGIN));
    set(prefix + AXIS_UPPER_MARGIN_SUFFIX, new Double(ValueAxis.DEFAULT_UPPER_MARGIN));
    set(prefix + VALUE_AXIS_VERTICAL_TICK_LABELS_SUFFIX, Boolean.FALSE);

    set(prefix + NUMBER_AXIS_AUTO_RANGE_INCLUDES_ZERO_SUFFIX,
            new Boolean(NumberAxis.DEFAULT_AUTO_RANGE_INCLUDES_ZERO));
    set(prefix + NUMBER_AXIS_AUTO_RANGE_STICKY_ZERO_SUFFIX,
            new Boolean(NumberAxis.DEFAULT_AUTO_RANGE_STICKY_ZERO));
    set(prefix + NUMBER_AXIS_RANGE_TYPE_SUFFIX, RangeType.FULL);
    set(prefix + NUMBER_AXIS_NUMBER_TICK_UNIT_SUFFIX, NumberAxis.DEFAULT_TICK_UNIT);
    set(prefix + NUMBER_AXIS_NUMBER_FORMAT_OVERRIDE_SUFFIX, (NumberFormat) null);

    set(prefix + DATE_AXIS_DATE_FORMAT_OVERRIDE_SUFFIX, (DateFormat) null);
    set(prefix + DATE_AXIS_LOWER_DATE_SUFFIX, DateAxis.DEFAULT_DATE_RANGE.getLowerDate());
    set(prefix + DATE_AXIS_UPPER_DATE_SUFFIX, DateAxis.DEFAULT_DATE_RANGE.getUpperDate());
    set(prefix + DATE_AXIS_DATE_TICK_MARK_POSITION_SUFFIX, DateTickMarkPosition.START);
    set(prefix + DATE_AXIS_DATE_TICK_UNIT_SUFFIX, DateAxis.DEFAULT_DATE_TICK_UNIT);

    set(prefix + CATEGORY_AXIS_CATEGORY_MARGIN_SUFFIX, new Double(CategoryAxis.DEFAULT_CATEGORY_MARGIN));
    set(prefix + CATEGORY_AXIS_LABEL_POSITIONS_SUFFIX, CategoryLabelPositions.STANDARD);
    set(prefix + CATEGORY_AXIS_LABEL_POSITION_OFFSET_SUFFIX, new Integer(4));
    set(prefix + CATEGORY_AXIS_MAXIMUM_LABEL_LINES_SUFFIX, new Integer(1));
    set(prefix + CATEGORY_AXIS_MAXIMUM_LABEL_WIDTH_RATIO_SUFFIX, new Float(0.0f));
}

From source file:com.aurel.track.exchange.excel.ExcelFieldMatchAction.java

/**
 * Render the field match: first time and after a sheet change
 *///w w w. j a va  2s  .  c  o  m
@Override
public String execute() {
    File fileOnDisk = new File(excelMappingsDirectory, fileName);
    workbook = ExcelFieldMatchBL.loadWorkbook(excelMappingsDirectory, fileName);
    if (workbook == null) {
        JSONUtility.encodeJSON(servletResponse,
                JSONUtility.encodeJSONFailure(getText("admin.actions.importExcel.err.noWorkbook")), false);
        fileOnDisk.delete();
        return null;
    }
    if (selectedSheet == null) {
        //first rendering (not submit because of sheet change)
        selectedSheet = Integer.valueOf(0);
    }
    //get the previous field mappings
    Map<String, Integer> columNameToFieldIDMap = null;
    Set<Integer> lastSavedIdentifierFieldIDIsSet = null;
    try {
        FileInputStream fis = new FileInputStream(new File(excelMappingsDirectory, mappingFileName));

        ObjectInputStream objectInputStream = new ObjectInputStream(fis);
        columNameToFieldIDMap = (Map<String, Integer>) objectInputStream.readObject();
        lastSavedIdentifierFieldIDIsSet = (Set<Integer>) objectInputStream.readObject();
        objectInputStream.close();
    } catch (FileNotFoundException e) {
        LOGGER.info("Creating the input stream for mapping failed with " + e.getMessage());
        LOGGER.debug(ExceptionUtils.getStackTrace(e));
    } catch (IOException e) {
        LOGGER.warn("Saving the mapping failed with " + e.getMessage());
        LOGGER.debug(ExceptionUtils.getStackTrace(e));
    } catch (ClassNotFoundException e) {
        LOGGER.warn("Class not found for  the mapping " + e.getMessage());
        LOGGER.debug(ExceptionUtils.getStackTrace(e));
    }
    //get the column index to header names from the excel sheet
    SortedMap<Integer, String> columnIndexToColumNameMap = ExcelFieldMatchBL.getFirstRowHeaders(workbook,
            selectedSheet);

    SortedSet<String> excelColumnNames = new TreeSet<String>();
    excelColumnNames.addAll(columnIndexToColumNameMap.values());
    //prepare the best field matching
    if (columNameToFieldIDMap == null) {
        columNameToFieldIDMap = new HashMap<String, Integer>();
    }
    ExcelFieldMatchBL.prepareBestMatchByLabel(excelColumnNames, columNameToFieldIDMap, locale);
    columnIndexToFieldIDMap = ExcelFieldMatchBL.getColumnIndexToFieldIDMap(columNameToFieldIDMap,
            columnIndexToColumNameMap);
    columnIndexIsIdentifierMap = new HashMap<Integer, Boolean>();
    //the saved identifier columns
    if (lastSavedIdentifierFieldIDIsSet != null && !lastSavedIdentifierFieldIDIsSet.isEmpty()) {
        for (Integer columnIndex : columnIndexToFieldIDMap.keySet()) {
            Integer fieldID = columnIndexToFieldIDMap.get(columnIndex);
            columnIndexIsIdentifierMap.put(columnIndex,
                    new Boolean(lastSavedIdentifierFieldIDIsSet.contains(fieldID)));
        }
    }
    //if issueNo is present it is always identifier (first time it should be preselected and any time when mapped also preselected)
    if (columnIndexToFieldIDMap.values().contains(SystemFields.INTEGER_ISSUENO)) {
        for (Integer columnIndex : columnIndexToFieldIDMap.keySet()) {
            Integer fieldID = columnIndexToFieldIDMap.get(columnIndex);
            if (SystemFields.INTEGER_ISSUENO.equals(fieldID)) {
                columnIndexIsIdentifierMap.put(columnIndex, new Boolean(true));
            }
        }
    }
    List<IntegerStringBean> sheetNames = ExcelFieldMatchBL.loadSheetNames(workbook);
    List<IntegerStringBean> matchableFieldsList = ExcelFieldMatchBL.getFieldConfigs(personID, locale);
    Map<Integer, String> columnIndexNumericToLetter = ExcelFieldMatchBL.getFirstRowNumericToLetter(workbook,
            selectedSheet);
    Set<Integer> possibleIdentifiersSet = ExcelFieldMatchBL.getPossibleIdentifierFields();
    Set<Integer> mandatoryIdentifiersSet = ExcelFieldMatchBL.getMandatoryIdentifierFields();
    JSONUtility.encodeJSON(servletResponse,
            ExcelImportJSON.getExcelFieldMatcherJSON(fileName, selectedSheet, sheetNames, matchableFieldsList,
                    columnIndexToColumNameMap, columnIndexNumericToLetter, columnIndexToFieldIDMap,
                    columnIndexIsIdentifierMap, possibleIdentifiersSet, mandatoryIdentifiersSet),
            false);
    return null;
}

From source file:com.aurel.track.fieldType.runtime.custom.check.CustomCheckBoxSingleRT.java

/**
 * Get the specific attribute from TTextBoxSettingsBean for default value
 */// w w w .  j  a  va2  s  .  co m
@Override
public Object getSpecificDefaultAttribute(TTextBoxSettingsBean textBoxSettingsBean) {
    if (BooleanFields.TRUE_VALUE.equals(textBoxSettingsBean.getDefaultChar())) {
        return new Boolean(true);
    }
    if (BooleanFields.FALSE_VALUE.equals(textBoxSettingsBean.getDefaultChar())) {
        return new Boolean(false);
    }
    return null;
}

From source file:userinterface.graph.Graph.java

/**
 * Initialises the GraphModel's series and canvas list. Also starts off the
 * graph update timer (one per chart)./*from   w ww . j  a  va  2s  .com*/
 * 
 * @param title
 *            Title of the graph.
 */
public Graph(String title) {
    super(ChartFactory.createXYLineChart(title, "X", "Y", new XYSeriesCollection(), PlotOrientation.VERTICAL,
            true, true, false));

    graphCache = new HashMap<SeriesKey, LinkedList<XYDataItem>>();
    keyToSeries = new HashMap<SeriesKey, XYSeries>();
    keyToGraphSeries = new HashMap<SeriesKey, SeriesSettings>();
    graphTitle = new MultipleLineStringSetting("title", title, "The main title heading for the chart.", this,
            false);
    titleFont = new FontColorSetting("title font",
            new FontColorPair(new Font("SansSerif", Font.PLAIN, 14), Color.black),
            "The font for the chart's title", this, false);
    legendVisible = new BooleanSetting("legend visible?", new Boolean(true),
            "Should the legend, which displays all of the series headings, be displayed?", this, false);

    String[] choices = { "Left", "Right", "Bottom", "Top" };
    legendPosition = new ChoiceSetting("legend position", choices, choices[RIGHT], "The position of the legend",
            this, false);
    legendFont = new FontColorSetting("legend font",
            new FontColorPair(new Font("SansSerif", Font.PLAIN, 11), Color.black), "The font for the legend",
            this, false);

    // Some easy references
    chart = super.getChart();
    plot = chart.getXYPlot();
    plot.setBackgroundPaint((Paint) Color.white);
    seriesCollection = (XYSeriesCollection) plot.getDataset();

    xAxisSettings = new AxisSettings("X", true, this);
    yAxisSettings = new AxisSettings("Y", false, this);

    xAxisSettings.addObserver(this);
    yAxisSettings.addObserver(this);

    displaySettings = new DisplaySettings(this);
    displaySettings.addObserver(this);

    seriesList = new SeriesSettingsList(this);

    // create a regular XY line chart
    XYItemRenderer r = plot.getRenderer();
    // if possible, try to match the old grapher
    if (r instanceof XYLineAndShapeRenderer) {
        XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r;
        renderer.setBaseShapesVisible(true);
        renderer.setBaseShapesFilled(true);
        renderer.setDrawSeriesLineAsPath(true);
        renderer.setAutoPopulateSeriesPaint(true);
        renderer.setAutoPopulateSeriesShape(true);
    }

    plot.setDrawingSupplier(new DefaultDrawingSupplier(SeriesSettings.DEFAULT_PAINTS,
            DefaultDrawingSupplier.DEFAULT_OUTLINE_PAINT_SEQUENCE,
            DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE,
            DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE, SeriesSettings.DEFAULT_SHAPES));

    super.setPopupMenu(null);

    /* Make sure the graph resembles its default settings. */
    updateGraph();

    // schedule a periodic timer for graph updates
    new java.util.Timer().scheduleAtFixedRate(new GraphUpdateTask(), 0, // start now
            updateInterval);
}