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

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

Introduction

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

Prototype

String EMPTY

To view the source code for org.apache.commons.lang StringUtils EMPTY.

Click Source Link

Document

The empty String "".

Usage

From source file:com.github.dryangkun.hbase.tidx.hive.ColumnMappings.java

String toNamesString(Properties tbl, String autogenerate) {
    if (autogenerate != null && autogenerate.equals("true")) {
        StringBuilder sb = new StringBuilder();
        HBaseSerDeHelper.generateColumns(tbl, Arrays.asList(columnsMapping), sb);
        return sb.toString();
    }/*from  w  w w.jav  a 2  s .  co m*/

    return StringUtils.EMPTY; // return empty string
}

From source file:info.magnolia.cms.gui.control.ButtonSet.java

public String getButtonHtmlInter() {
    if (this.buttonHtmlInter == null) {
        if (this.getButtonType() == BUTTONTYPE_PUSHBUTTON) {
            return StringUtils.EMPTY;
        }/*  ww  w  .  j  av  a  2  s  . co  m*/
        return BUTTONHTML_INTER_DIVIDED;
    }
    return this.buttonHtmlInter;
}

From source file:com.cyclopsgroup.waterview.Link.java

/**
 * Add query parameter//ww  w .j  a  v  a2s .c o m
 *
 * @param name Name of parameter
 * @param value Value of parameter
 * @return Link itself
 * @throws UnsupportedEncodingException Throw it out
 */
public Link addQueryData(String name, Object value) throws UnsupportedEncodingException {
    if (queryString == null) {
        queryString = new StringBuffer();
    } else {
        queryString.append('&');
    }
    String v = value == null ? StringUtils.EMPTY : value.toString();
    queryString.append(name).append('=').append(URLEncoder.encode(v, ENCODING));
    return this;
}

From source file:edu.cornell.med.icb.util.TestVersionUtils.java

/**
 * Validates functionality of {@link VersionUtils#getImplementationVersion(Class<?> )}
 * with a jar is readable but that has no implementation version attribute.
 *//*from w w  w  . j  a v  a2 s .  c om*/
@Test
public void getNoImplementationVersion() {
    final String version = VersionUtils.getImplementationVersion(org.junit.Test.class);
    assertNotNull("Version number should never be null", version);
    assertEquals("Version number should be empty", StringUtils.EMPTY, version);
}

From source file:info.magnolia.cms.core.search.QueryResultImpl.java

/**
 * Build required result objects/* ww w .  j  av  a 2  s.  c om*/
 */
private void build(Node node, String nodeType, Collection collection) throws RepositoryException {
    /**
     * All custom node types
     */
    if (node.isNodeType(nodeType)) {
        if (this.dirtyHandles.get(node.getPath()) == null) {
            boolean isAllowed = this.accessManager.isGranted(Path.getAbsolutePath(node.getPath()),
                    Permission.READ);
            if (isAllowed) {
                collection.add(new Content(node, this.accessManager));
                this.dirtyHandles.put(node.getPath(), StringUtils.EMPTY);
            }
        }
        return;
    }
    if (node.getDepth() > 0) {
        this.build(node.getParent(), nodeType, collection);
    }
}

From source file:com.microsoft.alm.plugin.idea.common.starters.ApplicationStarterBaseTest.java

@Before
public void setupLocalTests() {
    MockitoAnnotations.initMocks(this);
    PowerMockito.mockStatic(FileDocumentManager.class);
    PowerMockito.mockStatic(ApplicationManager.class);
    when(FileDocumentManager.getInstance()).thenReturn(mockFileDocumentManager);
    when(ApplicationManager.getApplication()).thenReturn(mockApplication);

    PowerMockito.mockStatic(TeamServicesSettingsService.class);
    when(TeamServicesSettingsService.getInstance()).thenReturn(teamServicesSettingsService);

    processCommandArgs = Collections.emptyList();
    processUriArgs = StringUtils.EMPTY;
}

From source file:fr.paris.lutece.plugins.workflow.modules.ticketing.service.task.TaskModifyTicketCategory.java

@Override
public String processTicketingTask(int nIdResourceHistory, HttpServletRequest request, Locale locale) {
    String strTaskInformation = StringUtils.EMPTY;

    Ticket ticket = getTicket(nIdResourceHistory);

    if (ticket != null) {
        String strNewCategoryId = request.getParameter(PARAMETER_TICKET_CATEGORY_ID);
        int nNewCategoryId = Integer.parseInt(strNewCategoryId);
        String strNewTypeId = request.getParameter(PARAMETER_TICKET_TYPE_ID);
        int nNewTypeId = Integer.parseInt(strNewTypeId);
        String strNewDomainId = request.getParameter(PARAMETER_TICKET_DOMAIN_ID);
        int nNewDomainId = Integer.parseInt(strNewDomainId);

        String strNewTypeLabel = TicketTypeHome.findByPrimaryKey(nNewTypeId).getLabel();
        String strNewDomainLabel = TicketDomainHome.findByPrimaryKey(nNewDomainId).getLabel();
        String strNewCategoryLabel = TicketCategoryHome.findByPrimaryKey(nNewCategoryId).getLabel();

        String strPreviousCategoryLabel = TicketCategoryHome.findByPrimaryKey(ticket.getIdTicketCategory())
                .getLabel();/*from  ww  w .j  a  v a 2s.  c o m*/
        String strPreviousDomainLabel = TicketDomainHome.findByPrimaryKey(ticket.getIdTicketDomain())
                .getLabel();
        String strPreviousTypeLabel = TicketTypeHome.findByPrimaryKey(ticket.getIdTicketType()).getLabel();

        ticket.setIdTicketType(nNewTypeId);
        ticket.setIdTicketDomain(nNewDomainId);
        ticket.setIdTicketCategory(nNewCategoryId);
        TicketHome.update(ticket);

        if (!strPreviousTypeLabel.equals(strNewTypeLabel) || !strPreviousDomainLabel.equals(strNewDomainLabel)
                || !strPreviousCategoryLabel.equals(strNewCategoryLabel)) {
            strTaskInformation = MessageFormat.format(
                    I18nService.getLocalizedString(MESSAGE_MODIFY_TICKET_CATEGORY_INFORMATION, Locale.FRENCH),
                    strPreviousTypeLabel, strPreviousDomainLabel, strPreviousCategoryLabel, strNewTypeLabel,
                    strNewDomainLabel, strNewCategoryLabel);
        }
    }

    return strTaskInformation;
}

From source file:fr.paris.lutece.plugins.directory.modules.gismap.business.RecordsResource.java

public static String getLink(Record record) {
    String strLink = StringUtils.EMPTY;
    Integer idDirectoryRecord = record.getIdRecord();
    Integer idDirectory = record.getDirectory().getIdDirectory();
    if (idDirectoryRecord != null && idDirectory != null) {
        strLink = URL_DIRECTORY_RECORD_DETAIL + PARAMETER_DIRECTORY_RECORD_ID + idDirectoryRecord + "&"
                + PARAMETER_DIRECTORY_ID + idDirectory;
    }/*from w w  w  .j  a  v  a2  s .  c  o m*/
    return strLink;
}

From source file:br.com.bluesoft.guardian.faker.Internet.java

/**
 * Same as image() but allows client code to choose a few image characteristics
 * @param width the image width/*from ww w. j av a 2s .c o m*/
 * @param height the image height
 * @param gray true for gray image and false for color image
 * @param text optional custom text on the selected picture
 * @return an url to a random image with the given characteristics.
 */
public String image(Integer width, Integer height, Boolean gray, String text) {
    return String.format("https://ssl.webpack.de/lorempixel.com/%s%s/%s/%s/%s", gray ? "g/" : StringUtils.EMPTY,
            width, height, fakeValuesService.fetchString("internet.image_category"),
            StringUtils.isEmpty(text) ? StringUtils.EMPTY : text);
}

From source file:fr.paris.lutece.plugins.rss.service.type.rss.Rss09FeedTypeProvider.java

/**
 * {@inheritDoc}/*from  ww w.j  a va  2 s. c  o m*/
 */
public Item getRSSItem(IFeedResourceItem resourceItem) {
    Item item = new Item();

    String strTitle = StringUtils.EMPTY;

    if (StringUtils.isNotBlank(resourceItem.getTitle())
            && (resourceItem.getTitle().length() >= ITEM_TITLE_MAX_LENGTH)) {
        strTitle = resourceItem.getTitle().substring(0, ITEM_TITLE_MAX_LENGTH - 1);
    } else {
        strTitle = resourceItem.getTitle();
    }

    item.setTitle(strTitle);
    item.setPubDate(resourceItem.getDate());
    item.setLink(resourceItem.getLink());

    Guid guid = new Guid();
    guid.setValue(resourceItem.getGUID());
    guid.setPermaLink(false);
    item.setGuid(guid);

    Content content = new Content();
    content.setValue(resourceItem.getDescription());
    item.setContent(content);

    return item;
}