Example usage for java.util List toString

List of usage examples for java.util List toString

Introduction

In this page you can find the example usage for java.util List toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:com.jfaker.framework.flow.web.TaskController.java

public void active() {
    List<String> list = ShiroUtils.getGroups();
    list.add(ShiroUtils.getUsername());/*from  ww w.  ja va  2 s. c  om*/
    log.info(list.toString());
    String[] assignees = new String[list.size()];
    list.toArray(assignees);

    Page<WorkItem> majorPage = new Page<WorkItem>(5);
    Page<WorkItem> aidantPage = new Page<WorkItem>(3);
    Page<HistoryOrder> ccorderPage = new Page<HistoryOrder>(3);
    List<WorkItem> majorWorks = engine.query().getWorkItems(majorPage,
            new QueryFilter().setOperators(assignees).setTaskType(TaskType.Major.ordinal()));
    List<WorkItem> aidantWorks = engine.query().getWorkItems(aidantPage,
            new QueryFilter().setOperators(assignees).setTaskType(TaskType.Aidant.ordinal()));
    List<HistoryOrder> ccWorks = engine.query().getCCWorks(ccorderPage,
            new QueryFilter().setOperators(assignees).setState(1));

    setAttr("majorWorks", majorWorks);
    setAttr("majorTotal", majorPage.getTotalCount());
    setAttr("aidantWorks", aidantWorks);
    setAttr("aidantTotal", aidantPage.getTotalCount());
    setAttr("ccorderWorks", ccWorks);
    setAttr("ccorderTotal", ccorderPage.getTotalCount());
    render("activeTask.jsp");
}

From source file:org.o3project.ocnrm.odenos.driver.controller.ResourceSendController.java

private List<String> makeOduFlow(RmData data, OptFlow optFlow, String seqNo) {
    AbstractFlowCreator flowCreator = new OduFlowCreator();
    List<String> flows = flowCreator.createFlow(optFlow, data, seqNo);
    logger.debug(seqNo + "\t" + "getFlow : " + flows.toString());
    return flows;
}

From source file:org.o3project.ocnrm.odenos.driver.controller.ResourceSendController.java

private List<String> makeDeleteOduFlow(RmData data, OptFlow optFlow, String seqNo) {
    AbstractFlowCreator flowCreator = new OduFlowCreator();
    List<String> flows = flowCreator.createFlow(optFlow, data, seqNo);
    logger.debug(seqNo + "\t" + "getFlow : " + flows.toString());
    return flows;
}

From source file:org.esupportail.ldapRestService.service.Ldap.java

public List<LdapUser> getLdapUsersByGroupId(String groupId)
        throws LdapUserNotFoundException, NullPointerException, LdapGroupNotFoundException {

    logger.info("Entree dans getLdapUsersByGroupId");
    logger.info("Le group a chercher est : " + groupId);

    List<LdapUser> ldapUserList = null;

    try {//from w w w  . ja v  a 2 s.com
        logger.info("Entree dans try");

        LdapGroup ldapGroup = ldapGroupMembersService.getLdapGroup(groupId);

        logger.info("ldapGroup => " + ldapGroup.toString());

        List<LdapUser> users = this.getMembers(ldapGroup);

        logger.info(users.toString());

    } catch (GroupNotFoundException e) {

        LdapGroupNotFoundException(e, groupId);
    }

    return ldapUserList;
}

From source file:EJBs.Operations.java

public List<String> getCategories() {
    List<String> results = em.createQuery("SELECT DISTINCT c.category FROM Products c where c.stock > 0")
            .getResultList();/*from w ww. ja v a 2 s  . com*/
    System.out.println("bhanu categories: " + results.toString());
    return results;
}

From source file:org.opendaylight.ovsdb.northbound.NodeResourceTest.java

@Test
public void testGetNodes() {
    ConnectionServiceImpl connectionService = new ConnectionServiceImpl();

    PowerMockito.mockStatic(ServiceHelper.class);
    when(ServiceHelper.getGlobalInstance(eq(OvsdbConnectionService.class), anyObject()))
            .thenReturn(connectionService).thenReturn(connectionService).thenReturn(connectionService);

    NodeResource nodeResource = new NodeResource();

    // Check getNodes when there are no nodes
    try {// w ww .j a v a  2s.  co  m
        Response response = nodeResource.getNodes();
        assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
        assertNotNull("entity should not be null", response.getEntity());
        String id = new String();
        List<String> ids = Lists.newArrayList();
        ids.add(id);
        assertEquals("there should be no nodes", ids.toString(), response.getEntity());
    } catch (JsonProcessingException ex) {
        fail("Exception should not have been caught");
    }

    // Check getNodes when there is a node
    Connection connection = new Connection(IDENTIFIER, null);
    connectionService.putOvsdbConnection(IDENTIFIER, connection);

    try {
        Response response = nodeResource.getNodes();
        assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
        assertNotNull("entity should not be null", response.getEntity());
        String id = new String("\"" + OVS_IDENTIFIER + "\"");
        List<String> ids = Lists.newArrayList();
        ids.add(id);
        assertEquals(OVS_IDENTIFIER + " should be found", ids.toString(), response.getEntity());
    } catch (JsonProcessingException ex) {
        fail("Exception should not have been caught");
    }

    // Check getNodes when there are multiple nodes
    connection = new Connection(IDENTIFIER2, null);
    connectionService.putOvsdbConnection(IDENTIFIER2, connection);

    try {
        Response response = nodeResource.getNodes();
        assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
        assertNotNull("entity should not be null", response.getEntity());
        String id = new String("\"" + OVS_IDENTIFIER + "\"");
        String id2 = new String("\"" + OVS_IDENTIFIER2 + "\"");
        List<String> ids = Lists.newArrayList();
        ids.add(id);
        ids.add(id2);
        assertEquals(OVS_IDENTIFIER + " and " + OVS_IDENTIFIER2 + " should be found",
                ids.toString().replaceAll("\\s", ""), response.getEntity());
    } catch (JsonProcessingException ex) {
        fail("Exception should not have been caught");
    }
}

From source file:com.nextep.designer.synch.services.impl.DataCaptureService.java

private String buildDataSelect(DBVendor vendor, IBasicTable t, List<IBasicColumn> columns) {
    final ISQLCommandWriter writer = SQLGenPlugin.getService(IGenerationService.class)
            .getSQLCommandWriter(vendor);
    // Preparing column list, comma seperated
    final List<String> colNames = buildNameList(writer, columns);
    String colNameList = colNames.toString();
    colNameList = colNameList.substring(1, colNameList.length() - 1);
    // Building SQL statement
    final StringBuilder buf = new StringBuilder(100);
    buf.append("SELECT "); //$NON-NLS-1$
    buf.append(colNameList).append(" FROM ").append(writer.escapeDbObjectName(t.getName())); //$NON-NLS-1$
    // buf.append(" order by " + colNameList);
    return buf.toString();
}

From source file:de.tudarmstadt.lt.lm.service.BreakIteratorStringProvider.java

@Override
public List<String>[] getNgrams(String text, String language_code) throws Exception {
    LOG.trace(String.format("Computing ngrams from text: %s", StringUtils.abbreviate(text, 200)));
    List<String>[] ngrams = null;

    for (String sentence : splitSentences(text, language_code)) {
        List<String> tokens = tokenizeSentence(sentence, language_code);
        if (tokens.isEmpty())
            continue;
        LOG.trace(String.format("Current sentence: %s", StringUtils.abbreviate(tokens.toString(), 200)));
        List<String>[] current_ngrams = getNgramSequenceFromSentence(tokens);

        LOG.trace(String.format("Current ngrams: %s",
                StringUtils.abbreviate(Arrays.toString(current_ngrams), 200)));
        if (ngrams == null)
            ngrams = current_ngrams;/*from  w  w w.  j a v a 2s  .co  m*/
        else
            ngrams = ArrayUtils.getConcatinatedArray(ngrams, current_ngrams);
    }

    if (ngrams == null)
        ngrams = EMPTY_NGRAM_LIST;
    LOG.trace(String.format("Ngrams for text: '%s': %s ", StringUtils.abbreviate(text, 200),
            StringUtils.abbreviate(Arrays.toString(ngrams), 200)));
    return ngrams;
}

From source file:android.net.http.AbstractProxyTest.java

private void assertContains(List<String> headers, String header) {
    assertTrue(headers.toString(), headers.contains(header));
}

From source file:com.helger.peppol.bdxrclient.BDXRClientReadOnly.java

/**
 * Extract the Endpoint from the signedServiceMetadata that matches the passed
 * process ID and the optional required transport profile.
 *
 * @param aSignedServiceMetadata//from   w w  w  .  j  a  va 2 s .  com
 *        The signed service meta data object (e.g. from a call to
 *        {@link #getServiceRegistrationOrNull(IParticipantIdentifier, IDocumentTypeIdentifier)}
 *        . May not be <code>null</code>.
 * @param aProcessID
 *        The process identifier to be looked up. May not be <code>null</code>
 *        .
 * @param aTransportProfile
 *        The required transport profile to be used. May not be
 *        <code>null</code>.
 * @return <code>null</code> if no matching endpoint was found
 */
@Nullable
public static EndpointType getEndpoint(@Nonnull final SignedServiceMetadataType aSignedServiceMetadata,
        @Nonnull final IProcessIdentifier aProcessID, @Nonnull final ISMPTransportProfile aTransportProfile) {
    ValueEnforcer.notNull(aSignedServiceMetadata, "SignedServiceMetadata");
    ValueEnforcer.notNull(aSignedServiceMetadata.getServiceMetadata(), "SignedServiceMetadata.ServiceMetadata");
    if (aSignedServiceMetadata.getServiceMetadata().getServiceInformation() == null) {
        // It seems to be a redirect and not service information
        return null;
    }
    ValueEnforcer.notNull(aSignedServiceMetadata.getServiceMetadata().getServiceInformation().getProcessList(),
            "SignedServiceMetadata.ServiceMetadata.ServiceInformation.ProcessList");
    ValueEnforcer.notNull(aProcessID, "ProcessID");
    ValueEnforcer.notNull(aTransportProfile, "TransportProfile");

    // Iterate all processes
    final ServiceInformationType aServiceInformation = aSignedServiceMetadata.getServiceMetadata()
            .getServiceInformation();
    if (aServiceInformation != null) {
        // Okay, it's not a redirect
        final List<ProcessType> aAllProcesses = aServiceInformation.getProcessList().getProcess();
        for (final ProcessType aProcessType : aAllProcesses) {
            // Matches the requested one?
            if (IdentifierHelper.areProcessIdentifiersEqual(aProcessType.getProcessIdentifier(), aProcessID)) {
                // Get all endpoints
                final List<EndpointType> aEndpoints = aProcessType.getServiceEndpointList().getEndpoint();
                // Filter by required transport profile
                final List<EndpointType> aRelevantEndpoints = new ArrayList<EndpointType>();
                for (final EndpointType aEndpoint : aEndpoints)
                    if (aTransportProfile.getID().equals(aEndpoint.getTransportProfile()))
                        aRelevantEndpoints.add(aEndpoint);

                if (aRelevantEndpoints.size() != 1) {
                    s_aLogger.warn("Found " + aRelevantEndpoints.size() + " endpoints for process " + aProcessID
                            + " and transport profile " + aTransportProfile.getID()
                            + (aRelevantEndpoints.isEmpty() ? ""
                                    : ": " + aRelevantEndpoints.toString() + " - using the first one"));
                }

                // Use the first endpoint or null
                return CollectionHelper.getFirstElement(aRelevantEndpoints);
            }
        }
    }
    return null;
}