Example usage for org.apache.commons.lang.builder ToStringStyle MULTI_LINE_STYLE

List of usage examples for org.apache.commons.lang.builder ToStringStyle MULTI_LINE_STYLE

Introduction

In this page you can find the example usage for org.apache.commons.lang.builder ToStringStyle MULTI_LINE_STYLE.

Prototype

ToStringStyle MULTI_LINE_STYLE

To view the source code for org.apache.commons.lang.builder ToStringStyle MULTI_LINE_STYLE.

Click Source Link

Document

The multi line toString style.

Usage

From source file:org.mzd.shap.analysis.hmmer.bean.DomainHit.java

@Override
public String toString() {
    return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("model", getModel())
            .append("index", getIndex()).append("ndom", getNdom()).append("seqFrom", getSeqFrom())
            .append("seqTo", getSeqTo()).append("seqStart", getSeqStart()).append("seqEnd", getSeqEnd())
            .append("hmmFrom", getHmmFrom()).append("hmmTo", getHmmTo()).append("hmmStart", getHmmStart())
            .append("hmmEnd", getHmmEnd()).append("score", getScore()).append("evalue", getEvalue())
            .append("querySeq", getQuerySeq()).append("subjectSeq", getSubjectSeq())
            .append("consensusSeq", getConsensusSeq()).toString();
}

From source file:org.mzd.shap.analysis.hmmer.bean.GlobalHit.java

@Override
public String toString() {
    return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("model", getModel())
            .append("description", getDescription()).append("evalue", getEvalue()).append("ndom", getNdom())
            .append("score", getScore()).toString();
}

From source file:org.mzd.shap.analysis.hmmer.bean.Hmmpfam.java

@Override
public String toString() {
    return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("databaseFile", getDatabaseFile())
            .append("sequenceFile", getSequenceFile()).append("results", getResults()).toString();
}

From source file:org.mzd.shap.analysis.hmmer.bean.Result.java

@Override
public String toString() {
    return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("query", getQuery())
            .append("globalHits", getGlobalHits()).append("domainHits", getDomainHits()).toString();
}

From source file:org.opencastproject.publication.youtube.YouTubeV3PublicationServiceImpl.java

/**
 * Publishes the element to the publication channel and returns a reference to the published version of the element.
 *
 * @param job// w ww . ja v a  2 s  .  c  o  m
 *          the associated job
 * @param mediaPackage
 *          the mediapackage
 * @param elementId
 *          the mediapackage element id to publish
 * @return the published element
 * @throws PublicationException
 *           if publication fails
 */
private Publication publish(final Job job, final MediaPackage mediaPackage, final String elementId)
        throws PublicationException {
    if (mediaPackage == null) {
        throw new IllegalArgumentException("Mediapackage must be specified");
    } else if (elementId == null) {
        throw new IllegalArgumentException("Mediapackage ID must be specified");
    }
    final MediaPackageElement element = mediaPackage.getElementById(elementId);
    if (element == null) {
        throw new IllegalArgumentException("Mediapackage element must be specified");
    }
    if (element.getIdentifier() == null) {
        throw new IllegalArgumentException("Mediapackage element must have an identifier");
    }
    if (element.getMimeType().toString().matches("text/xml")) {
        throw new IllegalArgumentException("Mediapackage element cannot be XML");
    }
    try {
        // create context strategy for publication
        final YouTubePublicationAdapter c = new YouTubePublicationAdapter(mediaPackage, workspace);
        final File file = workspace.get(element.getURI());
        final String episodeName = c.getEpisodeName();
        final UploadProgressListener operationProgressListener = new UploadProgressListener(mediaPackage, file);
        final String privacyStatus = makeVideosPrivate ? "private" : "public";
        final VideoUpload videoUpload = new VideoUpload(truncateTitleToMaxFieldLength(episodeName, false),
                c.getEpisodeDescription(), privacyStatus, file, operationProgressListener, tags);
        final Video video = youTubeService.addVideoToMyChannel(videoUpload);
        final int timeoutMinutes = 60;
        final long startUploadMilliseconds = new Date().getTime();
        while (!operationProgressListener.isComplete()) {
            Thread.sleep(POLL_MILLISECONDS);
            final long howLongWaitingMinutes = (new Date().getTime() - startUploadMilliseconds) / 60000;
            if (howLongWaitingMinutes > timeoutMinutes) {
                throw new PublicationException(
                        "Upload to YouTube exceeded " + timeoutMinutes + " minutes for episode " + episodeName);
            }
        }
        String playlistName = StringUtils
                .trimToNull(truncateTitleToMaxFieldLength(mediaPackage.getSeriesTitle(), true));
        playlistName = (playlistName == null) ? this.defaultPlaylist : playlistName;
        final Playlist playlist;
        final Playlist existingPlaylist = youTubeService.getMyPlaylistByTitle(playlistName);
        if (existingPlaylist == null) {
            playlist = youTubeService.createPlaylist(playlistName, c.getContextDescription(),
                    mediaPackage.getSeries());
        } else {
            playlist = existingPlaylist;
        }
        youTubeService.addPlaylistItem(playlist.getId(), video.getId());
        // Create new publication element
        final URL url = new URL("http://www.youtube.com/watch?v=" + video.getId());
        return PublicationImpl.publication(UUID.randomUUID().toString(), CHANNEL_NAME, url.toURI(),
                MimeTypes.parseMimeType(MIME_TYPE));
    } catch (Exception e) {
        logger.error("failed publishing to Youtube", e);
        logger.warn("Error publishing {}, {}", element, e.getMessage());
        if (e instanceof PublicationException) {
            throw (PublicationException) e;
        } else {
            throw new PublicationException("YouTube publish failed on job: "
                    + ToStringBuilder.reflectionToString(job, ToStringStyle.MULTI_LINE_STYLE), e);
        }
    }
}

From source file:org.opencastproject.publication.youtube.YouTubeV3PublicationServiceImpl.java

/**
 * Retracts the mediapackage from YouTube.
 *
 * @param job//from  w  w  w .j  ava 2  s . co m
 *          the associated job
 * @param mediaPackage
 *          the mediapackage
 * @throws PublicationException
 *           if retract did not work
 */
private Publication retract(final Job job, final MediaPackage mediaPackage) throws PublicationException {
    logger.info("Retract video from YouTube: {}", mediaPackage);
    Publication youtube = null;
    for (Publication publication : mediaPackage.getPublications()) {
        if (CHANNEL_NAME.equals(publication.getChannel())) {
            youtube = publication;
            break;
        }
    }
    if (youtube == null) {
        return null;
    }
    final YouTubePublicationAdapter contextStrategy = new YouTubePublicationAdapter(mediaPackage, workspace);
    final String episodeName = contextStrategy.getEpisodeName();
    try {
        retract(mediaPackage.getSeriesTitle(), episodeName);
    } catch (final Exception e) {
        logger.error("Failure retracting YouTube media {}", e.getMessage());
        throw new PublicationException("YouTube media retract failed on job: "
                + ToStringBuilder.reflectionToString(job, ToStringStyle.MULTI_LINE_STYLE), e);
    }
    return youtube;
}

From source file:org.openehr.am.archetype.ontology.ArchetypeOntology.java

/**
 * String representation of this object//  w  w w.  j a va  2  s  .  c om
 *
 * @return string form
 */
public String toString() {
    return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("primaryLanguage", primaryLanguage)
            .append("languages", languages).append("terminologies", terminologies)
            .append("termDefinitionsList", termDefinitionsList)
            .append("constraintDefinitionsList", constraintDefinitionsList)
            .append("termBindingList", termBindingList).append("constraintBindingList", constraintBindingList)
            .toString();
}

From source file:org.pentaho.di.core.util.KeyValueSet.java

/**
 * @return string representation.// w w  w. j  a  v a 2  s.co m
 */
public String toMultiLineString() {
    final ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE);
    for (KeyValue<?> keyValue : this.entries.values()) {
        builder.append(keyValue.getKey(), keyValue.getValue());
    }
    return builder.toString();
}

From source file:org.slc.sli.api.security.context.resolver.EdOrgHelper.java

/**
 * Get directly associated education organizations for the specified principal, filtered by
 * data ownership./*ww  w .j  a  v a 2  s . c om*/
 */
public Set<String> getDirectEdorgs(Entity principal) {
    LOG.trace(">>>getDirectEdorgs.getDirectEdorgs(using security principal)");
    LOG.trace("  principal: " + ToStringBuilder.reflectionToString(principal, ToStringStyle.MULTI_LINE_STYLE));
    return getEdOrgs(principal, true);
}

From source file:org.slc.sli.api.security.context.resolver.EdOrgHelper.java

private Set<String> getEdOrgs(Entity principal, boolean filterByOwnership) {
    LOG.trace(">>>EdOrgHelper.getDirectEdorgs()");
    LOG.trace("  principal: " + ToStringBuilder.reflectionToString(principal, ToStringStyle.MULTI_LINE_STYLE));
    LOG.trace("  filterByOwnership: " + filterByOwnership);

    Set<String> result = new HashSet<String>();

    if (isStaff(principal) || isTeacher(principal)) {
        LOG.trace("  ...staff or teacher");
        result = getStaffDirectlyAssociatedEdorgs(principal, filterByOwnership);
    } else if (isStudent(principal)) {
        LOG.trace("  ...student");
        result = getStudentsCurrentAssociatedEdOrgs(Collections.singleton(principal.getEntityId()),
                filterByOwnership);/*from www . jav a2  s .c  om*/
    } else if (isParent(principal)) {
        LOG.trace("  ...parent");
        SLIPrincipal prince = new SLIPrincipal();
        prince.setEntity(principal);
        prince.populateChildren(repo);
        result = getStudentsCurrentAssociatedEdOrgs(prince.getOwnedStudentIds(), false);
    }

    if (result == null) {
        LOG.debug("  ...method did not do anything so return empty set...");
    }

    return result;
}