All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.dd4t.providers.StringResultItemImpl Maven / Gradle / Ivy

There is a newer version: 2.1.12
Show newest version
package org.dd4t.providers;

import org.dd4t.core.util.Constants;
import org.dd4t.providers.ProviderResultItem;
import org.joda.time.DateTime;

import java.util.Date;

/**
 * dd4t-parent
 *
 * @author R. Kempees
 */
public class StringResultItemImpl implements ProviderResultItem {

    private String sourceContent;
    private DateTime lastPublishDate;
    private DateTime revisionDate;


    @Override
    public String getSourceContent () {
        return sourceContent;
    }

    @Override
    public void setContentSource (final String source) {
        this.sourceContent = source;
    }

    @Override
    public DateTime getLastPublishDate () {
        return this.lastPublishDate != null ? this.lastPublishDate : Constants.THE_YEAR_ZERO;
    }

    @Override
    public void setLastPublishDate (final Date lastPublishDate) {

        if (lastPublishDate == null) {
            this.lastPublishDate = Constants.THE_YEAR_ZERO;
        } else {
            this.lastPublishDate = new DateTime(lastPublishDate);
        }
    }

    @Override
    public DateTime getRevisionDate () {
        return this.revisionDate;
    }

    @Override
    public void setRevisionDate (final Date revisionDate) {
        if (revisionDate == null) {
            this.revisionDate = Constants.THE_YEAR_ZERO;
        } else {
            this.revisionDate = new DateTime(revisionDate);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy