Example usage for java.lang Boolean equals

List of usage examples for java.lang Boolean equals

Introduction

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

Prototype

public boolean equals(Object obj) 

Source Link

Document

Returns true if and only if the argument is not null and is a Boolean object that represents the same boolean value as this object.

Usage

From source file:org.apache.hadoop.hive.ql.optimizer.pcr.PcrExprProcFactory.java

static Boolean opNot(Boolean op) {
    // When people forget to quote a string, op1/op2 is null.
    // For example, select * from some_table where not ds > 2012-12-1 .
    if (op != null) {
        if (op.equals(Boolean.TRUE)) {
            return Boolean.FALSE;
        }/*from   w w  w.j  av  a2 s  .  c  o m*/
        if (op.equals(Boolean.FALSE)) {
            return Boolean.TRUE;
        }
    }
    return null;
}

From source file:org.apache.hadoop.hive.ql.optimizer.pcr.PcrExprProcFactory.java

static Boolean ifResultsAgree(Boolean[] resultVector) {
    Boolean result = null;
    for (Boolean b : resultVector) {
        if (b == null) {
            return null;
        } else if (result == null) {
            result = b;/*from ww  w.ja va2  s  .c o m*/
        } else if (!result.equals(b)) {
            return null;
        }
    }
    return result;
}

From source file:tools.help.java

public static void printl(String printer, Boolean printPrinter) {

    if (printPrinter.equals(true)) {
        System.out.println(printer);
    }/*  w  w w .  j a  v a 2s  .  c om*/

}

From source file:tools.help.java

public static void info(String printer, Boolean printPrinter) {

    if (printPrinter.equals(true)) {
        System.out.println("INFO TEST: " + printer);
    }//from  ww w.  ja va 2  s  .  co  m

}

From source file:org.alfresco.repo.dictionary.ModelUtils.java

/**
 * @param sa/*  ww  w  .  j a v a2  s . c o m*/
 * @param sb
 * @return
 */
public static boolean compareBoolean(Boolean sa, Boolean sb) {
    if (sa == null) {
        if (sb == null) {
            return false;
        } else {
            return true;
        }
    } else if (sa.equals(sb)) {
        return false;
    } else {
        return true;
    }
}

From source file:gov.nih.nci.evs.browser.utils.MappingSearchUtils.java

public static String getMappingRelationsContainerName(String scheme, String version) {
    CodingSchemeVersionOrTag versionOrTag = new CodingSchemeVersionOrTag();
    if (version != null) {
        versionOrTag.setVersion(version);
    }// w  w w  .j a  v a 2  s . co  m

    String relationsContainerName = null;
    try {
        LexBIGService lbSvc = RemoteServerUtil.createLexBIGService();
        CodingScheme cs = lbSvc.resolveCodingScheme(scheme, versionOrTag);
        if (cs == null)
            return null;

        java.util.Enumeration<? extends Relations> relations = cs.enumerateRelations();
        while (relations.hasMoreElements()) {
            Relations relation = (Relations) relations.nextElement();
            Boolean isMapping = relation.getIsMapping();
            if (isMapping != null && isMapping.equals(Boolean.TRUE)) {
                relationsContainerName = relation.getContainerName();
                break;
            }
        }

        if (relationsContainerName == null) {
            //System.out.println("WARNING: Mapping container not found in " + scheme);
            return null;
        }
    } catch (Exception ex) {
        ex.printStackTrace();
    }
    return relationsContainerName;
}

From source file:gov.nih.nci.evs.browser.utils.MappingSearchUtils.java

public static ResolvedConceptReferencesIterator getRestrictedMappingDataIterator(String scheme, String version,
        List<MappingSortOption> sortOptionList, ResolvedConceptReferencesIterator searchResultsIterator,
        SearchContext context) {/*from   w  w w. j av  a 2s.  c om*/

    if (searchResultsIterator == null)
        return null;
    /*
          try {
             int numRemaining = searchResultsIterator.numberRemaining();
             //System.out.println("searchResultsIterator passing number of matches: " + numRemaining);
          } catch (Exception e) {
             e.printStackTrace();
             return null;
          }
    */

    CodingSchemeVersionOrTag versionOrTag = new CodingSchemeVersionOrTag();
    if (version != null) {
        versionOrTag.setVersion(version);
    }
    String relationsContainerName = null;

    LexBIGService distributed = RemoteServerUtil.createLexBIGService();
    try {
        CodingScheme cs = distributed.resolveCodingScheme(scheme, versionOrTag);
        if (cs == null)
            return null;

        java.util.Enumeration<? extends Relations> relations = cs.enumerateRelations();
        while (relations.hasMoreElements()) {
            Relations relation = (Relations) relations.nextElement();
            Boolean isMapping = relation.getIsMapping();
            if (isMapping != null && isMapping.equals(Boolean.TRUE)) {
                relationsContainerName = relation.getContainerName();
                break;
            }
        }

        if (relationsContainerName == null) {
            //System.out.println("WARNING: Mapping container not found in " + scheme);
            return null;
        }

        MappingExtension mappingExtension = (MappingExtension) distributed
                .getGenericExtension("MappingExtension");

        Mapping mapping = mappingExtension.getMapping(scheme, versionOrTag, relationsContainerName);

        //ConceptReferenceList codeList (to be derived based on ResolvedConceptReferencesIterator searchResultsIterator)
        ConceptReferenceList codeList = new ConceptReferenceList();

        int lcv = 0;
        while (searchResultsIterator.hasNext()) {
            ResolvedConceptReference[] refs = searchResultsIterator.next(100).getResolvedConceptReference();
            for (ResolvedConceptReference ref : refs) {
                lcv++;
                //System.out.println("(" + lcv + ") " + ref.getEntityDescription().getContent() + "(" + ref.getCode() + ")");
                codeList.addConceptReference((ConceptReference) ref);
            }
        }

        mapping = mapping.restrictToCodes(codeList, context);
        ResolvedConceptReferencesIterator itr = mapping.resolveMapping(sortOptionList);
        return itr;

    } catch (Exception ex) {
        ex.printStackTrace();
    }
    return null;
}

From source file:org.alfresco.extension.scripting.webscripts.JavascriptServicePost.java

@Override
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status) {
    Boolean shellEnabled = Boolean.valueOf(req.getParameter("shellEnabled"));
    if (!shellEnabled.equals(getJavascriptShellService().isRunning())) {
        getJavascriptShellService().toggleEnabled();
    }/*from  www . j  a  va2s .c  om*/
    return super.executeImpl(req, status);
}

From source file:com.blogspot.chicchiricco.persistence.AbstractBaseBean.java

/**
 * @param value the boolean value to be represented as integer
 * @return the integer corresponding to the property param
 *///from  w w w.  j av a2 s .  c om
public final Integer getBooleanAsInteger(final Boolean value) {
    return value.equals(Boolean.TRUE) ? 1 : 0;
}

From source file:org.openmrs.module.pmtct.BooleanEditor.java

public String getAsText() {
    Boolean t = (Boolean) getValue();
    if (t == null)
        return null;
    else if (t.equals("false"))
        return "0";
    else//from  ww  w  . j a  v a 2s  .c o m
        return "1";
}