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

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

Introduction

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

Prototype

public static boolean equals(final CharSequence cs1, final CharSequence cs2) 

Source Link

Document

Compares two CharSequences, returning true if they represent equal sequences of characters.

null s are handled without exceptions.

Usage

From source file:com.github.rvesse.airline.utils.predicates.parser.GroupFinder.java

@Override
public boolean evaluate(CommandGroupMetadata group) {
    return group != null && StringUtils.equals(this.name, group.getName());
}

From source file:io.wcm.handler.url.rewriter.impl.ComparableAttributes.java

@Override
public boolean equals(Object obj) {
    if (!(obj instanceof Attributes)) {
        return false;
    }//from  www .  ja  v  a2s .  c o m
    return StringUtils.equals(serializedString(this), serializedString((Attributes) obj));
}

From source file:io.adeptj.runtime.server.IdmUtil.java

static Account verifyAccount(Map<String, List<String>> userRolesMapping, Account account) {
    return userRolesMapping.entrySet().stream()
            .anyMatch(entry -> StringUtils.equals(entry.getKey(), account.getPrincipal().getName())
                    && entry.getValue().containsAll(account.getRoles())) ? account : null;
}

From source file:cop.raml.TestUtils.java

public static void assertThatEquals(String actual, String expected) {
    String[] arrActual = Utils.splitLine(actual);
    String[] arrExpected = Utils.splitLine(expected);

    for (int i = 0, len = Math.min(arrActual.length, arrExpected.length); i < len; i++) {
        if (!StringUtils.equals(arrActual[i], arrExpected[i]))
            System.err.println("Line: " + (i + 1));
        assertThat(arrActual[i]).isEqualTo(arrExpected[i]);
    }/*from  w ww  . j  a va 2  s.  c o m*/

    assertThat(arrActual.length).isEqualTo(arrExpected.length);
}

From source file:io.wcm.caravan.pipeline.extensions.hal.filter.HalResourceMatchers.java

/**
 * @param relationToMatch Relation of the {@code item}
 * @return True if resource is an {@code item} of the given relation.
 *///from  www.j a v  a2s .co  m
public static HalResourcePredicate collection(String relationToMatch) {
    return new HalResourcePredicate() {

        @Override
        public String getId() {
            return "MATCHES(/" + relationToMatch + "/item)";
        }

        @Override
        public boolean apply(HalPath halPath, HalResource hal) {
            return StringUtils.equals("item", halPath.current())
                    && StringUtils.equals(relationToMatch, halPath.last(1));
        }
    };
}

From source file:de.micromata.genome.tpsb.httpmockup.MockServletDef.java

public void setLoadOnStartupString(String l) {
    loadOnStartup = StringUtils.equals(l, "true");
}

From source file:io.wcm.wcm.ui.extjs.provider.impl.servlets.DummyPredicateProvider.java

@Override
public Predicate getPredicate(String name) {
    if (StringUtils.equals(name, PREDICATE_PAGENAME_PAGE1)) {
        return new Predicate() {

            @Override//from w  w w  . j  av  a 2 s . c o  m
            public boolean evaluate(Object object) {
                Page page = (Page) object;
                return StringUtils.equals(page.getName(), "page1");
            }
        };
    }
    return null;
}

From source file:ch.cyberduck.core.local.WorkdirPrefixer.java

public String normalize(final String name) {
    if (StringUtils.equals(name, ".")) {
        return finder.find().getAbsolute();
    }/*from   www. ja  v  a 2s . c  o m*/
    if (StringUtils.equals(name, "..")) {
        return finder.find().getParent().getAbsolute();
    }
    if (!this.isAbsolute(name)) {
        return String.format("%s%s%s", finder.find().getAbsolute(),
                PreferencesFactory.get().getProperty("local.delimiter"), name);
    }
    return name;
}

From source file:io.wcm.handler.url.suffix.PageTemplateFilter.java

@Override
public boolean includes(Page page) {
    return StringUtils.equals(page.getProperties().get(NameConstants.PN_TEMPLATE, String.class), templatePath);
}

From source file:com.cognifide.qa.bb.aem.touch.siteadmin.aem62.TemplateList.java

void selectTemplate(String templateName) {
    WebElement template = templates.stream()
            .filter(t -> StringUtils.equals(
                    t.findElement(By.cssSelector("coral-card-content coral-card-title")).getText(),
                    templateName))/* w w  w.j  av  a  2 s.  c o  m*/
            .findFirst().orElseThrow(() -> new IllegalArgumentException("Template not found: " + templateName));

    template.click();
}