Java Code Examples for org.alfresco.service.cmr.search.IntervalSet#getLabel()

The following examples show how to use org.alfresco.service.cmr.search.IntervalSet#getLabel() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SearchMapper.java    From alfresco-remote-api with GNU Lesser General Public License v3.0 6 votes vote down vote up
protected void validateSets(Set<IntervalSet> intervalSets, String prefix)
{
    if (intervalSets != null && !intervalSets.isEmpty())
    {
        for (IntervalSet aSet:intervalSets)
        {
            ParameterCheck.mandatory(prefix+" sets start", aSet.getStart());
            ParameterCheck.mandatory(prefix+" sets end", aSet.getEnd());

            if (aSet.getLabel() == null)
            {
                aSet.setLabel(aSet.toRange());
            }
        }
    }
}
 
Example 2
Source File: SearchDateConversion.java    From alfresco-data-model with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static IntervalSet parseDateInterval(IntervalSet theSet, boolean isDate)
{
    if (isDate)
    {
        Pair<Date, Integer> dateAndResolution1 = parseDateString(theSet.getStart());
        Pair<Date, Integer> dateAndResolution2 = parseDateString(theSet.getEnd());
        String start = dateAndResolution1 == null ? theSet.getStart()
                    : (theSet.isStartInclusive() ? getDateStart(dateAndResolution1) : getDateEnd(dateAndResolution1));
        String end = dateAndResolution2 == null ?  theSet.getEnd()
                    : (theSet.isEndInclusive() ? getDateEnd(dateAndResolution2) : getDateStart(dateAndResolution2));
        return new IntervalSet(start, end, theSet.getLabel(), theSet.isStartInclusive(), theSet.isEndInclusive());

    }
    return theSet;
}