mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merge branch 'master' of https://github.com/Alfresco/alfresco-data-model
This commit is contained in:
@@ -29,7 +29,9 @@ import org.codehaus.jackson.annotate.JsonCreator;
|
||||
import org.codehaus.jackson.annotate.JsonProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Parameters used for a search Interval.
|
||||
@@ -38,17 +40,17 @@ public class Interval
|
||||
{
|
||||
private final String field;
|
||||
private final String label;
|
||||
private final List<IntervalSet> sets;
|
||||
private final Set<IntervalSet> sets;
|
||||
|
||||
@JsonCreator
|
||||
public Interval(
|
||||
@JsonProperty("field") String field,
|
||||
@JsonProperty("label") String label,
|
||||
@JsonProperty("sets") List<IntervalSet> sets)
|
||||
@JsonProperty("sets") Set<IntervalSet> sets)
|
||||
{
|
||||
this.field = field;
|
||||
this.label = label;
|
||||
this.sets = sets == null ? new ArrayList<>() :sets;
|
||||
this.sets = sets == null ? new HashSet() :sets;
|
||||
}
|
||||
|
||||
public String getField()
|
||||
@@ -61,7 +63,7 @@ public class Interval
|
||||
return label;
|
||||
}
|
||||
|
||||
public List<IntervalSet> getSets()
|
||||
public Set<IntervalSet> getSets()
|
||||
{
|
||||
return sets;
|
||||
}
|
||||
|
@@ -30,6 +30,7 @@ import org.codehaus.jackson.annotate.JsonCreator;
|
||||
import org.codehaus.jackson.annotate.JsonProperty;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Parameters used for search Intervals.
|
||||
@@ -37,19 +38,19 @@ import java.util.List;
|
||||
@AlfrescoPublicApi
|
||||
public class IntervalParameters
|
||||
{
|
||||
private final List<IntervalSet> sets;
|
||||
private final Set<IntervalSet> sets;
|
||||
private final List<Interval> intervals;
|
||||
|
||||
@JsonCreator
|
||||
public IntervalParameters(
|
||||
@JsonProperty("sets") List<IntervalSet> sets,
|
||||
@JsonProperty("sets") Set<IntervalSet> sets,
|
||||
@JsonProperty("intervals") List<Interval> intervals)
|
||||
{
|
||||
this.sets = sets;
|
||||
this.intervals = intervals;
|
||||
}
|
||||
|
||||
public List<IntervalSet> getSets()
|
||||
public Set<IntervalSet> getSets()
|
||||
{
|
||||
return sets;
|
||||
}
|
||||
|
@@ -37,7 +37,7 @@ public class IntervalSet
|
||||
{
|
||||
private final String start;
|
||||
private final String end;
|
||||
private final String label;
|
||||
private String label;
|
||||
private final boolean startInclusive;
|
||||
private final boolean endInclusive;
|
||||
|
||||
@@ -71,6 +71,11 @@ public class IntervalSet
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(String label)
|
||||
{
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public boolean isStartInclusive()
|
||||
{
|
||||
return startInclusive;
|
||||
@@ -128,4 +133,38 @@ public class IntervalSet
|
||||
", endInclusive=" + endInclusive +
|
||||
'}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o)
|
||||
{
|
||||
if (this == o)
|
||||
return true;
|
||||
if (o == null || getClass() != o.getClass())
|
||||
return false;
|
||||
|
||||
IntervalSet that = (IntervalSet) o;
|
||||
|
||||
if (startInclusive != that.startInclusive)
|
||||
return false;
|
||||
if (endInclusive != that.endInclusive)
|
||||
return false;
|
||||
if (start != null ? !start.equals(that.start) : that.start != null)
|
||||
return false;
|
||||
if (end != null ? !end.equals(that.end) : that.end != null)
|
||||
return false;
|
||||
if (label != null ? !label.equals(that.label) : that.label != null)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
int result = start != null ? start.hashCode() : 0;
|
||||
result = 31 * result + (end != null ? end.hashCode() : 0);
|
||||
result = 31 * result + (startInclusive ? 1 : 0);
|
||||
result = 31 * result + (endInclusive ? 1 : 0);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user