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

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

Introduction

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

Prototype

public static boolean equals(String str1, String str2) 

Source Link

Document

Compares two Strings, returning true if they are equal.

Usage

From source file:com.iggroup.oss.restdoclet.doclet.util.AnnotationUtils.java

/**
 * Checks if an argument of a method is annotated with an annotation.
 * /*ww w .j a  v a  2  s . c  o  m*/
 * @param param the argument to check for annotations.
 * @param type the type of annotation to look for.
 * @return <code>true</code> if the argument is annotated,
 *         <code>false</code> otherwise.
 */
public static boolean isAnnotated(final Parameter param, final Class<?> type) {
    boolean result = false;
    for (final AnnotationDesc annotation : annotations(param)) {
        final String name = annotation.annotationType().qualifiedName();
        if (StringUtils.equals(type.getName(), name)) {
            result = true;
            break;
        }
    }
    return result;
}

From source file:com.glluch.profilesparser.ProfileHtmlReader.java

/**
 * A method that makes some inicializations and avoid repeet them.
 * @param filename The html file where the profile is stored.
 * @throws IOException can't not read a file.
 */// w w  w  .j a va  2 s .c o  m
public void init(String filename) throws IOException {
    if (!StringUtils.equals(this.filename, filename)) {
        this.input = new File(filename);
        doc = Jsoup.parse(input, "UTF-8");
        allTxt = doc.getElementById("clipboard_text").text();
    }
}

From source file:com.skymobi.monitor.model.Chart.java

@Override
public boolean equals(Object o) {
    if (this == o)
        return true;
    if (!(o instanceof Chart))
        return false;

    Chart that = (Chart) o;//from   w ww. j  a  v  a2 s  .c om

    return StringUtils.equals(that.getName(), this.getName());
}

From source file:com.inkubator.hrm.web.personalia.LoanDetailController.java

@PostConstruct
@Override/*  w w  w. j a v a 2s. c  om*/
public void initialization() {
    try {
        super.initialization();
        String execution = FacesUtil.getRequestParameter("execution");
        String param = execution.substring(0, 1);
        if (StringUtils.equals(param, "e")) {
            /* parameter (id) ini datangnya dari loan Flow atau View */
            selectedLoan = loanService.getEntityByPkWithDetail(Long.parseLong(execution.substring(1)));

        } else {
            /* parameter (activityNumber) ini datangnya dari home approval request history View */
            selectedLoan = loanService.getEntityByApprovalActivityNumberWithDetail(execution.substring(1));

        }

        selectedApprovalActivity = approvalActivityService
                .getEntityByActivityNumberLastSequence(selectedLoan.getApprovalActivityNumber());
        loanPaymentDetails = loanPaymentDetailService.getAllDataByLoanId(selectedLoan.getId());

    } catch (Exception ex) {
        LOGGER.error("Error", ex);

    }
}

From source file:com.daimler.spm.b2bacceleratoraddon.forms.AdvancedSearchForm.java

public boolean isCreateOrderFormSearchResultType() {
    return StringUtils.equals(searchResultType, "create-order-form");
}

From source file:com.mmj.app.common.authority.Right.java

public static Right getAction(String desc) {
    if (StringUtils.isEmpty(desc)) {
        return null;
    }/*from   w w  w.  ja  va 2  s. c  o  m*/
    for (Right type : values()) {
        if (StringUtils.equals(desc, type.getDesc()))
            return type;
    }
    return null;
}

From source file:biz.netcentric.cq.tools.actool.validators.Validators.java

public static boolean isValidPermission(String permission) {
    if (permission == null) {
        return false;
    }//from   w ww  . j  a v  a 2s .c o  m

    if (StringUtils.equals("allow", permission) || StringUtils.equals("deny", permission)) {
        return true;
    }
    return false;
}

From source file:com.googlecode.markuputils.MarkupBuilderUnitTest.java

@Test(dataProvider = "elements", dependsOnMethods = { "markupBuilder" })
public void openElement(String element) {
    String expected = "<" + element + ">";
    MarkupBuilder builder = new MarkupBuilder();

    builder.openElement(element);//  www  . ja  va  2  s .  c  om
    String testValue = builder.toMarkup();

    String msg = new StringBuilder().append("Expected: ").append(expected).append(", Found: ").append(testValue)
            .toString();
    logger.info(msg);

    assert StringUtils.equals(expected, testValue) : msg;
}

From source file:com.inkubator.hrm.web.recruitment.VacancyAdvertisementDetailController.java

@PostConstruct
@Override/*from  w  ww  . java 2s  .  co  m*/
public void initialization() {
    try {
        super.initialization();
        String execution = FacesUtil.getRequestParameter("execution");
        String param = execution.substring(0, 1);
        if (StringUtils.equals(param, "e")) {
            /* parameter (id) ini datangnya dari loan Flow atau View */
            vacancyAdvertisement = recruitVacancyAdvertisementService
                    .getEntityByPkWithDetail(Long.parseLong(execution.substring(1)));
        } else {
            /* parameter (activityNumber) ini datangnya dari home approval request history View */
            vacancyAdvertisement = recruitVacancyAdvertisementService
                    .getEntityByApprovalActivityNumberWithDetail(execution.substring(1));
        }

        lastApprovalActivity = approvalActivityService
                .getEntityByActivityNumberLastSequence(vacancyAdvertisement.getApprovalActivityNumber());
    } catch (Exception ex) {
        LOGGER.error("Error", ex);

    }
}

From source file:com.inkubator.hrm.web.workingtime.LeaveImplementationDetailController.java

@PostConstruct
@Override/*from w ww  . j ava 2  s.  c  om*/
public void initialization() {
    try {
        super.initialization();
        listLeaveImplDate = new ArrayList<LeaveImplementationDate>();
        String execution = FacesUtil.getRequestParameter("execution");
        String param = execution.substring(0, 1);
        if (StringUtils.equals(param, "e")) {
            /* parameter (id) ini datangnya dari leave implementation View */
            selectedLeaveImplementation = leaveImplementationService
                    .getEntityByPkWithDetail(Long.parseLong(execution.substring(1)));
        } else {
            /* parameter (activityNumber) ini datangnya dari home approval request history View */
            selectedLeaveImplementation = leaveImplementationService
                    .getEntityByApprovalActivityNumberWithDetail(execution.substring(1));
            //jika null, maka ambil entity dari previous activity number-nya
            if (selectedLeaveImplementation == null) {
                ApprovalActivity prev = approvalActivityService
                        .getEntityByActivityNumberLastSequence(execution.substring(1));
                selectedLeaveImplementation = leaveImplementationService
                        .getEntityByApprovalActivityNumberWithDetail(prev.getPreviousActivityNumber());
            }
        }

        //sort by actual date
        listLeaveImplDate.addAll(selectedLeaveImplementation.getLeaveImplementationDates());
        listLeaveImplDate = Lambda.sort(listLeaveImplDate,
                Lambda.on(LeaveImplementationDate.class).getActualDate());
        selectedApprovalActivity = approvalActivityService
                .getEntityByActivityNumberLastSequence(selectedLeaveImplementation.getApprovalActivityNumber());
    } catch (Exception ex) {
        LOGGER.error("Error", ex);

    }
}