Example usage for java.lang Boolean toString

List of usage examples for java.lang Boolean toString

Introduction

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

Prototype

public String toString() 

Source Link

Document

Returns a String object representing this Boolean's value.

Usage

From source file:edu.ucsd.crbs.cws.dao.rest.JobRestDAOImpl.java

@Override
public List<Job> getJobs(String owner, String status, Boolean notSubmittedToScheduler, boolean noParams,
        boolean noWorkflowParams, final Boolean showDeleted) throws Exception {
    ClientConfig cc = new DefaultClientConfig();
    cc.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
    Client client = Client.create(cc);/*from   www  . j  a  va2 s.co  m*/
    client.addFilter(new HTTPBasicAuthFilter(_user.getLogin(), _user.getToken()));
    client.setFollowRedirects(true);
    WebResource resource = client.resource(_restURL).path(Constants.REST_PATH).path(Constants.JOBS_PATH);
    MultivaluedMap queryParams = _multivaluedMapFactory.getMultivaluedMap(_user);

    if (owner != null) {
        queryParams.add(Constants.OWNER_QUERY_PARAM, owner);
    }

    if (status != null) {
        queryParams.add(Constants.STATUS_QUERY_PARAM, status);
    }

    if (notSubmittedToScheduler != null) {
        queryParams.add(Constants.NOTSUBMITTED_TO_SCHED_QUERY_PARAM, notSubmittedToScheduler.toString());
    }

    if (noParams == true) {
        queryParams.add(Constants.NOPARAMS_QUERY_PARAM, Boolean.TRUE.toString());
    }

    if (noWorkflowParams == true) {
        queryParams.add(Constants.NOWORKFLOWPARAMS_QUERY_PARAM, Boolean.TRUE.toString());
    }
    if (showDeleted != null) {
        queryParams.add(Constants.SHOW_DELETED_QUERY_PARAM, showDeleted.toString());
    }

    String json = resource.queryParams(queryParams).accept(MediaType.APPLICATION_JSON).get(String.class);
    ObjectMapper mapper = new ObjectMapper();
    mapper.registerModule(new ObjectifyJacksonModule());
    return mapper.readValue(json, new TypeReference<List<Job>>() {
    });
}

From source file:com.amalto.workbench.utils.XSDAnnotationsStructure.java

public boolean setFKIntegrityOverride(Boolean integrityOverride) {
    boolean somethingChanged = setAppInfo("X_FKIntegrity_Override", //$NON-NLS-1$
            integrityOverride == null ? null : integrityOverride.toString(), true);
    hasChanged = hasChanged | somethingChanged;
    return somethingChanged;
}

From source file:lcmc.gui.resources.EditableInfo.java

/** Adds parameters to the panel. */
private void addParams(final JPanel optionsPanel, final String prefix, final String[] params,
        final MyButton thisApplyButton, final int leftWidth, final int rightWidth,
        final Map<String, Widget> sameAsFields) {
    if (params == null) {
        return;/*  ww w. j  ava 2  s  .c o  m*/
    }
    final MultiKeyMap<String, JPanel> panelPartsMap = new MultiKeyMap<String, JPanel>();
    final List<PanelPart> panelPartsList = new ArrayList<PanelPart>();
    final MultiKeyMap<String, Integer> panelPartRowsMap = new MultiKeyMap<String, Integer>();

    for (final String param : params) {
        final Widget paramWi = createWidget(param, prefix, rightWidth);
        /* sub panel */
        final String section = getSection(param);
        JPanel panel;
        final ConfigData.AccessType accessType = getAccessType(param);
        final String accessTypeString = accessType.toString();
        final Boolean advanced = isAdvanced(param);
        final String advancedString = advanced.toString();
        if (panelPartsMap.containsKey(section, accessTypeString, advancedString)) {
            panel = panelPartsMap.get(section, accessTypeString, advancedString);
            panelPartRowsMap.put(section, accessTypeString, advancedString,
                    panelPartRowsMap.get(section, accessTypeString, advancedString) + 1);
        } else {
            panel = new JPanel(new SpringLayout());
            panel.setBackground(Browser.PANEL_BACKGROUND);
            if (advanced) {
                advancedPanelList.add(panel);
                final JPanel p = panel;
                SwingUtilities.invokeLater(new Runnable() {
                    @Override
                    public void run() {
                        p.setVisible(Tools.getConfigData().isAdvancedMode());
                    }
                });
            }
            panelPartsMap.put(section, accessTypeString, advancedString, panel);
            panelPartsList.add(new PanelPart(section, accessType, advanced));
            panelPartRowsMap.put(section, accessTypeString, advancedString, 1);
        }

        /* label */
        final JLabel label = new JLabel(getParamShortDesc(param));
        final String longDesc = getParamLongDesc(param);
        paramWi.setLabel(label, longDesc);

        /* tool tip */
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                paramWi.setToolTipText(getToolTipText(param));
                label.setToolTipText(longDesc);
            }
        });
        int height = 0;
        if (paramWi.getType() == Widget.Type.LABELFIELD) {
            height = Tools.getDefaultSize("Browser.LabelFieldHeight");
        }
        addField(panel, label, paramWi, leftWidth, rightWidth, height);
    }
    for (final String param : params) {
        final Widget paramWi = getWidget(param, prefix);
        Widget rpwi = null;
        if ("wizard".equals(prefix)) {
            rpwi = getWidget(param, null);
            if (rpwi == null) {
                Tools.appError("unkown param: " + param + ". Man pages not installed?");
                continue;
            }
            int height = 0;
            if (rpwi.getType() == Widget.Type.LABELFIELD) {
                height = Tools.getDefaultSize("Browser.LabelFieldHeight");
            }
            final Widget rpwi0 = rpwi;
            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    if (paramWi.getValue() == null || paramWi.getValue() == Widget.NOTHING_SELECTED) {
                        rpwi0.setValueAndWait(null);
                    } else {
                        final Object value = paramWi.getStringValue();
                        rpwi0.setValueAndWait(value);
                    }
                }
            });
        }
    }
    for (final String param : params) {
        final Widget paramWi = getWidget(param, prefix);
        Widget rpwi = null;
        if ("wizard".equals(prefix)) {
            rpwi = getWidget(param, null);
        }
        final Widget realParamWi = rpwi;
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                paramWi.addListeners(new WidgetListener() {
                    @Override
                    public void check(final Object value) {
                        checkParameterFields(paramWi, realParamWi, param, params, thisApplyButton);
                    }
                });

            }
        });
    }

    /* add sub panels to the option panel */
    final Map<String, JPanel> sectionMap = new HashMap<String, JPanel>();
    final Set<JPanel> notAdvancedSections = new HashSet<JPanel>();
    final Set<JPanel> advancedSections = new HashSet<JPanel>();
    for (final PanelPart panelPart : panelPartsList) {
        final String section = panelPart.getSection();
        final ConfigData.AccessType accessType = panelPart.getAccessType();
        final String accessTypeString = accessType.toString();
        final Boolean advanced = panelPart.isAdvanced();
        final String advancedString = advanced.toString();

        final JPanel panel = panelPartsMap.get(section, accessTypeString, advancedString);
        final int rows = panelPartRowsMap.get(section, accessTypeString, advancedString);
        final int columns = 2;
        SpringUtilities.makeCompactGrid(panel, rows, columns, 1, 1, // initX, initY
                1, 1); // xPad, yPad
        JPanel sectionPanel;
        if (sectionMap.containsKey(section)) {
            sectionPanel = sectionMap.get(section);
        } else {
            sectionPanel = getParamPanel(section);
            sectionMap.put(section, sectionPanel);
            optionsPanel.add(sectionPanel);
            if (sameAsFields != null) {
                final Widget sameAsCombo = sameAsFields.get(section);
                if (sameAsCombo != null) {
                    final JPanel saPanel = new JPanel(new SpringLayout());
                    saPanel.setBackground(Browser.BUTTON_PANEL_BACKGROUND);
                    final JLabel label = new JLabel("Same As");
                    sameAsCombo.setLabel(label, "");
                    addField(saPanel, label, sameAsCombo, leftWidth, rightWidth, 0);
                    SpringUtilities.makeCompactGrid(saPanel, 1, 2, 1, 1, // initX, initY
                            1, 1); // xPad, yPad
                    sectionPanel.add(saPanel);
                }
            }
        }
        sectionPanel.add(panel);
        if (advanced) {
            advancedSections.add(sectionPanel);
        } else {
            notAdvancedSections.add(sectionPanel);
        }
    }
    boolean advanced = false;
    for (final JPanel sectionPanel : sectionMap.values()) {
        if (advancedSections.contains(sectionPanel)) {
            advanced = true;
        }
        if (!notAdvancedSections.contains(sectionPanel)) {
            advancedOnlySectionList.add(sectionPanel);
            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    sectionPanel.setVisible(Tools.getConfigData().isAdvancedMode());
                }
            });
        }
    }
    final boolean a = advanced;
    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            moreOptionsPanel.setVisible(a && !Tools.getConfigData().isAdvancedMode());
        }
    });
}

From source file:edu.ucsd.crbs.cws.dao.rest.WorkspaceFileRestDAOImpl.java

@Override
public WorkspaceFile updatePathSizeAndFailStatus(long workspaceFileId, String path, final String size,
        final Boolean isFailed) throws Exception {
    ClientConfig cc = new DefaultClientConfig();
    cc.getClasses().add(StringProvider.class);
    cc.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
    Client client = Client.create(cc);//  ww  w  . j a v a2 s.  c o m
    client.addFilter(new HTTPBasicAuthFilter(_user.getLogin(), _user.getToken()));
    client.setFollowRedirects(true);
    WebResource resource = client.resource(_restURL).path(Constants.REST_PATH)
            .path(Constants.WORKSPACEFILES_PATH).path(Long.toString(workspaceFileId));

    MultivaluedMap queryParams = _multivaluedMapFactory.getMultivaluedMap(_user);
    if (path != null) {
        queryParams.add(Constants.PATH_QUERY_PARAM, path);
    }

    if (size != null) {
        queryParams.add(Constants.SIZE_QUERY_PARAM, size);
    }
    if (isFailed != null) {
        queryParams.add(Constants.WS_FAILED_QUERY_PARAM, isFailed.toString());
    }

    String json = resource.queryParams(queryParams).accept(MediaType.APPLICATION_JSON)
            .type(MediaType.APPLICATION_JSON_TYPE).entity("{}").post(String.class);

    ObjectMapper mapper = new ObjectMapper();
    mapper.registerModule(new ObjectifyJacksonModule());
    return mapper.readValue(json, new TypeReference<WorkspaceFile>() {
    });
}

From source file:de.andreasgiemza.jgeagle.options.Options.java

public void save(String eagleBinary, String schematicBackground, String boardBackground, String schematicDpi,
        String unchangedSchematicAlpha, String boardDpi, String unchangedBoardAlpha, String addedElementColor,
        String removedElementColor, String undefinedColor, String layersTop, String layersOther,
        String layersBottom, String presetRepo, Boolean followGit) {
    properties.clear();//from w  ww.  j  a va 2 s  .c o m

    properties.setProperty(EAGLE_BINARY, eagleBinary);
    properties.setProperty(SCHEMATIC_BACKGROUND, schematicBackground);
    properties.setProperty(BOARD_BACKGROUND, boardBackground);
    properties.setProperty(SCHEMATIC_DPI, schematicDpi);
    properties.setProperty(UNCHANGED_SCHEMATIC_ALPHA, unchangedSchematicAlpha);
    properties.setProperty(BOARD_DPI, boardDpi);
    properties.setProperty(UNCHANGED_BOARD_ALPHA, unchangedBoardAlpha);
    properties.setProperty(ADDED_ELEMENTS_COLOR, addedElementColor);
    properties.setProperty(REMOVED_ELEMENT_COLOR, removedElementColor);
    properties.setProperty(UNDEFINED_COLOR, undefinedColor);
    properties.setProperty(LAYERS_TOP, layersTop);
    properties.setProperty(LAYERS_OTHER, layersOther);
    properties.setProperty(LAYERS_BOTTOM, layersBottom);
    properties.setProperty(PRESET_REPO, presetRepo);
    properties.setProperty(FOLLOW_GIT, followGit.toString());

    try {
        properties.store(new FileOutputStream(optionsFile.toFile()), null);
    } catch (IOException ex) {
        Logger.getLogger(Options.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:org.fusesource.restygwt.client.codec.EncoderDecoderTestGwt.java

public void testBooleanToStringDecode() {
    Boolean b = true;
    assertEquals(b.toString(),
            AbstractJsonEncoderDecoder.STRING.decode(AbstractJsonEncoderDecoder.BOOLEAN.encode(b)));
}

From source file:edu.isi.karma.rdf.OfflineRdfGenerator.java

private KR2RMLRDFWriter createBloomFilterWriter(PrintWriter bloomfilterpw, Boolean isRDF, String baseURI)
        throws Exception {

    Reflections reflections = new Reflections("edu.isi.karma.kr2rml.writer");

    Set<Class<? extends KR2RMLRDFWriter>> subTypes = reflections.getSubTypesOf(KR2RMLRDFWriter.class);

    for (Class<? extends KR2RMLRDFWriter> subType : subTypes) {
        if (!Modifier.isAbstract(subType.getModifiers()) && !subType.isInterface()
                && subType.getName().equals("BloomFilterKR2RMLRDFWriter"))
            try {
                KR2RMLRDFWriter writer = subType.newInstance();
                writer.setWriter(bloomfilterpw);
                Properties p = new Properties();
                p.setProperty("is.rdf", isRDF.toString());
                p.setProperty("base.uri", baseURI);
                writer.initialize(p);//from  ww  w  .j a v a 2 s. co m
                return writer;
            } catch (Exception e) {
                bloomfilterpw.close();
                throw new Exception("Unable to instantiate bloom filter writer", e);
            }
    }

    bloomfilterpw.close();
    throw new Exception("Bloom filter writing support not enabled.  Please recompile with -Pbloom");
}

From source file:com.amalto.workbench.utils.XSDAnnotationsStructure.java

public boolean setRetrieveFKinfos(Boolean retrieveFKinfos) {
    boolean somethingChanged = removeAppInfos("X_Retrieve_FKinfos");//$NON-NLS-1$
    if (retrieveFKinfos != null) {
        hasChanged = addAppInfo("X_Retrieve_FKinfos", retrieveFKinfos.toString());//$NON-NLS-1$
        return true;
    }/*from  ww  w  .j  av a2s. c om*/
    hasChanged |= somethingChanged;
    return true;
}

From source file:com.collabnet.ccf.pi.cee.pt.v50.ProjectTrackerWriter.java

private String convertAttributeValue(FieldValueTypeValue fieldType, Object fieldValue,
        String targetSystemTimezone) {
    String attributeValue = null;
    if (fieldValue == null)
        return null;
    if (fieldType == FieldValueTypeValue.STRING) {
        attributeValue = fieldValue.toString();
    } else if (fieldType == FieldValueTypeValue.INTEGER) {
        attributeValue = fieldValue.toString();
    } else if (fieldType == FieldValueTypeValue.DOUBLE) {
        attributeValue = fieldValue.toString();
    } else if (fieldType == FieldValueTypeValue.DATE) {
        GregorianCalendar gc = (GregorianCalendar) fieldValue;
        attributeValue = Long.toString(gc.getTime().getTime());
    } else if (fieldType == FieldValueTypeValue.DATETIME) {
        Date date = (Date) fieldValue;
        if (!StringUtils.isEmpty(targetSystemTimezone)
                && (!targetSystemTimezone.equals(GenericArtifact.VALUE_UNKNOWN))) {
            try {
                date = DateUtil.convertDate(date, targetSystemTimezone);
            } catch (ParseException e) {
                // This will never happen
            }//from   w  ww .ja v a  2s .c om
        }
        attributeValue = Long.toString(date.getTime());
    } else if (fieldType == FieldValueTypeValue.BOOLEAN) {
        Boolean value = (Boolean) fieldValue;
        attributeValue = value.toString();
    } else if (fieldType == FieldValueTypeValue.BASE64STRING) {
        attributeValue = fieldValue.toString();
    } else if (fieldType == FieldValueTypeValue.HTMLSTRING) {
        attributeValue = fieldValue.toString();
    } else if (fieldType == FieldValueTypeValue.USER) {
        attributeValue = fieldValue.toString();
    }
    return attributeValue;
}

From source file:pt.meocloud.sdk.MeoCloudImpl.java

/**
 * Returns all metadata regarding a file or folder.
 * @param pathName file or folder to retrieve the metadata
 * @param fileLimit maximum entries returned. This method haves a limit of 25.000 entries, the default value is 10.000
 * @param hash used to check if the file or folder contents have changed.
 * @param includeDeleted specifies if the response includes deleted files and folders
 * @param rev specifies a revision for a file or folder
 * @return {@link MeoCloudResponse}//from ww w.ja va  2  s .  c  om
 * */
@Override
public MeoCloudResponse<Metadata> metadata(String pathName, Integer fileLimit, String hash, Boolean list,
        Boolean includeDeleted, String rev) {
    List<NameValuePair> queryParameters = new ArrayList<>();
    if (fileLimit != null)
        queryParameters.add(new BasicNameValuePair(FILE_LIMIT_PARAM, fileLimit.toString()));
    if (hash != null)
        queryParameters.add(new BasicNameValuePair(HASH_PARAM, hash));
    if (list != null)
        queryParameters.add(new BasicNameValuePair(LIST_PARAM, list.toString()));
    if (includeDeleted != null)
        queryParameters.add(new BasicNameValuePair(INCLUDE_DELETED_PARAM, includeDeleted.toString()));
    if (rev != null)
        queryParameters.add(new BasicNameValuePair(REV_PARAM, rev));
    Response response = performRequest(false, MEOCLOUD_API_METHOD_METADATA, pathName, queryParameters, Verb.GET,
            true);
    if (response != null) {
        String responseBody = getResponseBody(response);
        log.debug("Metadata response: {}", responseBody);
        MeoCloudResponse<Metadata> meoCloudResponse = new MeoCloudResponse<>();
        meoCloudResponse.setCode(response.getCode());
        if (response.getCode() == HttpStatus.SC_OK && responseBody != null)
            meoCloudResponse.setResponse(Metadata.fromJson(responseBody, Metadata.class));
        else
            process(meoCloudResponse, response.getCode());
        return meoCloudResponse;
    }
    return null;
}