Example usage for org.apache.commons.lang StringUtils isNotEmpty

List of usage examples for org.apache.commons.lang StringUtils isNotEmpty

Introduction

In this page you can find the example usage for org.apache.commons.lang StringUtils isNotEmpty.

Prototype

public static boolean isNotEmpty(String str) 

Source Link

Document

Checks if a String is not empty ("") and not null.

Usage

From source file:cn.cuizuoli.appranking.typehandler.MediaTypeTypeHandler.java

@Override
public MediaType getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
    MediaType mediaType = null;// w ww  .  j a  v a2s . c o m
    String s = rs.getString(columnIndex);
    if (StringUtils.isNotEmpty(s)) {
        mediaType = MediaType.getObject(s);
    }
    return mediaType;
}

From source file:com.atlassian.webdriver.greenhopper.page.admin.GreenHopperLicenseDetailsPage.java

@Init
private void readLicense() {
    if (Check.elementExists(By.className("errMsg"), updateLicenseForm)) {
        errorMessage = updateLicenseForm.findElement(By.className("errMsg")).getText();
    }// ww  w. ja  va  2s. c  om

    List<WebElement> rows = licenseTable.findElements(By.tagName("tr"));

    organisation = rows.get(0).findElement(ByJquery.$("td ~ td")).getText();

    if (StringUtils.isNotEmpty(organisation)) {
        licenseIsLoaded = true;

        purchaseDate = formatDate(rows.get(1).findElement(ByJquery.$("td ~ td strong")).getText());

        WebElement licenseTypeColumn = rows.get(2).findElement(ByJquery.$("td ~ td"));

        licenseType = licenseTypeColumn.findElement(By.tagName("strong")).getText();
        expiryDate = formatDate(extractExpiryDate(licenseTypeColumn.getText()));

        serverId = rows.get(3).findElement(ByJquery.$("td ~ td strong")).getText();

        supportEntitlmentNumber = rows.get(4).findElement(ByJquery.$("td ~ td strong")).getText();

    }

}

From source file:com.benfante.minimark.blo.AssessmentXMLFOBuilderTest.java

/**
 * Test of makeXMLFO method, of class AssessmentXMLFOBuilder.
 *//*from  ww w . j a  v  a2 s. c  om*/
public void testMakeXMLFO() {
    List<AssessmentFilling> assessments = assessmentFillingDao.findAll();
    assertNotEmpty(assessments);
    final AssessmentFilling assessment = assessments.get(0);
    assertNotNull(assessment.getStartDate());
    assertSize(4, assessment.getQuestions());
    String xmlfo = assessmentXMLFOBuilder.makeXMLFO(assessment, Locale.ENGLISH);
    assertTrue("XMLFO is empty", StringUtils.isNotEmpty(xmlfo));
}

From source file:edu.ku.brc.specify.tools.schemalocale.LocalizableJListItem.java

@Override
public String toString() {
    return StringUtils.isNotEmpty(displayName) ? displayName : name;
}

From source file:com.bstek.dorado.console.system.log.console.SystemOutMonitor.java

@Expose
public List<LogLine> last() {

    DoradoContext ctx = DoradoContext.getCurrent();
    String listenerId = (String) ctx.getAttribute(DoradoContext.VIEW, listenerIdKey);

    SystemOutTailWork sysLog = SystemOutTailWork.getInstance();
    synchronized (sysLog) {
        if (!sysLog.isOnWork()) {
            sysLog.startWork();//www . jav a 2  s  .  com
        }
    }

    ExpirablePublisher publisher = sysLog.getPublisher();

    ExpirableLogBuffer logBuffer = null;
    if (StringUtils.isNotEmpty(listenerId)) {
        logBuffer = publisher.find(listenerId);
    }

    if (logBuffer == null) {
        logBuffer = publisher.create();
        publisher.register(logBuffer);
    }

    if (StringUtils.isEmpty(listenerId)) {
        listenerId = publisher.listenerId(logBuffer);
        ctx.setAttribute(DoradoContext.VIEW, listenerIdKey, listenerId);
    }

    return logBuffer.getLastLines();
}

From source file:it.govpay.web.rs.dars.anagrafica.iban.input.IdNegozio.java

@Override
protected String getDefaultValue(List<RawParamValue> values, Object... objects) {
    String attivatoObepValue = Utils.getValue(values, this.attivatoObepId);

    if (StringUtils.isNotEmpty(attivatoObepValue) && Boolean.parseBoolean(attivatoObepValue)) {
        return "";
    }//from   w  w w.j  a va  2s.  co m

    return null;
}

From source file:com.pureinfo.srm.view.function.GetNationTeam.java

public Object perform(Object[] _s_args, IDVContext _s_context) throws PureException {
    PingGuParameterVO vo = (PingGuParameterVO) LocalContextHelper
            .getAttribute(PingGuConstants.ATTRIBUTE_NAME_OF_PARAMETER);
    if (vo == null) {
        return "";
    }/*from  ww w  . j ava 2  s  . c om*/
    IObjects objs = null;
    IStatement query = null;
    Organization org = (Organization) _s_context.getObject();
    double totalScale = 0;

    try {
        objs = TeamPingGuHelper.getObjs(org.getCode(), vo.getStartDate(), vo.getEndDate());
        Team team = null;
        while ((team = (Team) objs.next()) != null) {

            String teamHonor = team.getTeamHonor();
            if (StringUtils.isNotEmpty(teamHonor) && teamHonor.indexOf("01") != -1) {// 3
                List deptList = team.getDeptList();
                for (Iterator iterator = deptList.iterator(); iterator.hasNext();) {
                    ObjDeptMapping deptMapping = (ObjDeptMapping) iterator.next();
                    if (deptMapping.getDeptId() == org.getId()) {
                        totalScale += deptMapping.getWeightScale();
                        break;
                    }
                }
            } else {
                continue;
            }
        }

        return new Double(SCORE * totalScale);
    } finally {
        if (objs != null)
            objs.clear();
        if (query != null)
            query.clear();
    }
}

From source file:gov.nih.nci.cabig.caaers.service.synchronizer.TreatmentAssignmentSynchronizer.java

public void migrate(Study dbStudy, Study xmlStudy, DomainObjectImportOutcome<Study> outcome) {
    //create an Index of existing ones (available in DB)
    Hashtable<String, TreatmentAssignment> dbTacIndexMap = new Hashtable<String, TreatmentAssignment>();
    Hashtable<String, TreatmentAssignment> dbCtepIndexMap = new Hashtable<String, TreatmentAssignment>();
    for (TreatmentAssignment ta : dbStudy.getActiveTreatmentAssignments()) {
        String ctepDbId = StringUtils.upperCase(ta.getCtepDbIdentifier());
        String tac = StringUtils.upperCase(ta.getCode());
        dbTacIndexMap.put(tac, ta);/*from   ww  w .j  ava 2  s .  c  o  m*/
        if (StringUtils.isNotEmpty(ctepDbId))
            dbCtepIndexMap.put(ctepDbId, ta);
    }

    //Identify New TreatmentAssignments and also update existing ones.
    for (TreatmentAssignment xmlTreatmentAssignment : xmlStudy.getTreatmentAssignments()) {

        // //CAAERS-7367 - /REFACTORED - always prefer the tac that is available.
        String ctepDbId = StringUtils.upperCase(xmlTreatmentAssignment.getCtepDbIdentifier());
        String tac = StringUtils.upperCase(xmlTreatmentAssignment.getCode());
        if (StringUtils.isEmpty(tac) && StringUtils.isEmpty(ctepDbId))
            continue; //no I cannot process this record
        TreatmentAssignment ta = null;

        //try to identify the TA by ctep-id
        if (StringUtils.isNotEmpty(ctepDbId)) {
            ta = dbCtepIndexMap.get(ctepDbId);
        }
        //TA not found : try to find by tac
        if (ta == null)
            ta = dbTacIndexMap.get(tac);

        //still tac null -- create a new one.
        if (ta == null) {
            ta = xmlTreatmentAssignment;
            dbStudy.addTreatmentAssignment(xmlTreatmentAssignment);
            continue;
        }

        //it is an existing TA, so lets sync up the attributes
        ta.setCtepDbIdentifier(xmlTreatmentAssignment.getCtepDbIdentifier());
        ta.setCode(xmlTreatmentAssignment.getCode());
        ta.setDescription(xmlTreatmentAssignment.getDescription());
        ta.setComments(xmlTreatmentAssignment.getComments());
        ta.setDoseLevelOrder(xmlTreatmentAssignment.getDoseLevelOrder());

        //marking the TA as processed by removing it from index
        dbTacIndexMap.remove(tac);

    }

    //soft delete - all the TAs that were not present in XML Study
    AbstractMutableRetireableDomainObject.retire(dbTacIndexMap.values());

}

From source file:com.haulmont.cuba.gui.xml.layout.loaders.CssLayoutLoader.java

protected void loadResponsive(CssLayout component, Element element) {
    String responsive = element.attributeValue("responsive");
    if (StringUtils.isNotEmpty(responsive)) {
        component.setResponsive(BooleanUtils.toBoolean(element.attributeValue("responsive")));
    }//from   w w w . j  av a  2 s . c  o  m
}

From source file:net.bible.android.control.readingplan.ReadingPlanControl.java

/** allow front end to determine if a plan needs has been selected
 *///www. ja  va2 s.  c om
public boolean isReadingPlanSelected() {
    return StringUtils.isNotEmpty(getCurrentPlanCode());
}