Java Code Examples for org.springframework.beans.support.MutableSortDefinition

The following examples show how to use org.springframework.beans.support.MutableSortDefinition. These examples are extracted from open source projects. 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 Project: spring-init   Source File: Vet.java    License: Apache License 2.0 5 votes vote down vote up
@XmlElement
public List<Specialty> getSpecialties() {
    List<Specialty> sortedSpecs = new ArrayList<>(getSpecialtiesInternal());
    PropertyComparator.sort(sortedSpecs,
            new MutableSortDefinition("name", true, true));
    return Collections.unmodifiableList(sortedSpecs);
}
 
Example 2
Source Project: amazon-ecs-java-microservices   Source File: Vet.java    License: Apache License 2.0 5 votes vote down vote up
@XmlElement
public List<Specialty> getSpecialties() {
    List<Specialty> sortedSpecs = new ArrayList<>(getSpecialtiesInternal());
    PropertyComparator.sort(sortedSpecs,
            new MutableSortDefinition("name", true, true));
    return Collections.unmodifiableList(sortedSpecs);
}
 
Example 3
Source Project: amazon-ecs-java-microservices   Source File: Vet.java    License: Apache License 2.0 5 votes vote down vote up
@XmlElement
public List<Specialty> getSpecialties() {
    List<Specialty> sortedSpecs = new ArrayList<>(getSpecialtiesInternal());
    PropertyComparator.sort(sortedSpecs,
            new MutableSortDefinition("name", true, true));
    return Collections.unmodifiableList(sortedSpecs);
}
 
Example 4
Source Project: amazon-ecs-java-microservices   Source File: Vet.java    License: Apache License 2.0 5 votes vote down vote up
@XmlElement
public List<Specialty> getSpecialties() {
    List<Specialty> sortedSpecs = new ArrayList<>(getSpecialtiesInternal());
    PropertyComparator.sort(sortedSpecs,
            new MutableSortDefinition("name", true, true));
    return Collections.unmodifiableList(sortedSpecs);
}
 
Example 5
Source Project: amazon-ecs-java-microservices   Source File: Vet.java    License: Apache License 2.0 5 votes vote down vote up
@XmlElement
public List<Specialty> getSpecialties() {
    List<Specialty> sortedSpecs = new ArrayList<>(getSpecialtiesInternal());
    PropertyComparator.sort(sortedSpecs,
            new MutableSortDefinition("name", true, true));
    return Collections.unmodifiableList(sortedSpecs);
}
 
Example 6
Source Project: amazon-ecs-java-microservices   Source File: Vet.java    License: Apache License 2.0 5 votes vote down vote up
@XmlElement
public List<Specialty> getSpecialties() {
    List<Specialty> sortedSpecs = new ArrayList<>(getSpecialtiesInternal());
    PropertyComparator.sort(sortedSpecs,
            new MutableSortDefinition("name", true, true));
    return Collections.unmodifiableList(sortedSpecs);
}
 
Example 7
Source Project: amazon-ecs-java-microservices   Source File: Vet.java    License: Apache License 2.0 5 votes vote down vote up
@XmlElement
public List<Specialty> getSpecialties() {
    List<Specialty> sortedSpecs = new ArrayList<>(getSpecialtiesInternal());
    PropertyComparator.sort(sortedSpecs,
            new MutableSortDefinition("name", true, true));
    return Collections.unmodifiableList(sortedSpecs);
}
 
Example 8
Source Project: amazon-ecs-java-microservices   Source File: Vet.java    License: Apache License 2.0 5 votes vote down vote up
@XmlElement
public List<Specialty> getSpecialties() {
    List<Specialty> sortedSpecs = new ArrayList<>(getSpecialtiesInternal());
    PropertyComparator.sort(sortedSpecs,
            new MutableSortDefinition("name", true, true));
    return Collections.unmodifiableList(sortedSpecs);
}
 
Example 9
Source Project: amazon-ecs-java-microservices   Source File: Vet.java    License: Apache License 2.0 5 votes vote down vote up
@XmlElement
public List<Specialty> getSpecialties() {
    List<Specialty> sortedSpecs = new ArrayList<>(getSpecialtiesInternal());
    PropertyComparator.sort(sortedSpecs,
            new MutableSortDefinition("name", true, true));
    return Collections.unmodifiableList(sortedSpecs);
}
 
Example 10
Source Project: amazon-ecs-java-microservices   Source File: Vet.java    License: Apache License 2.0 5 votes vote down vote up
@XmlElement
public List<Specialty> getSpecialties() {
    List<Specialty> sortedSpecs = new ArrayList<>(getSpecialtiesInternal());
    PropertyComparator.sort(sortedSpecs,
            new MutableSortDefinition("name", true, true));
    return Collections.unmodifiableList(sortedSpecs);
}
 
Example 11
Source Project: amazon-ecs-java-microservices   Source File: Vet.java    License: Apache License 2.0 5 votes vote down vote up
@XmlElement
public List<Specialty> getSpecialties() {
    List<Specialty> sortedSpecs = new ArrayList<>(getSpecialtiesInternal());
    PropertyComparator.sort(sortedSpecs,
            new MutableSortDefinition("name", true, true));
    return Collections.unmodifiableList(sortedSpecs);
}
 
Example 12
Source Project: amazon-ecs-java-microservices   Source File: Vet.java    License: Apache License 2.0 5 votes vote down vote up
@XmlElement
public List<Specialty> getSpecialties() {
    List<Specialty> sortedSpecs = new ArrayList<>(getSpecialtiesInternal());
    PropertyComparator.sort(sortedSpecs,
            new MutableSortDefinition("name", true, true));
    return Collections.unmodifiableList(sortedSpecs);
}
 
Example 13
Source Project: nextreports-server   Source File: SortableDataAdapter.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public Iterator<T> iterator(long first, long count) {
	long size = provider.size();
	List<T> resources = new ArrayList<T>((int) size);
	Iterator<? extends T> iter = provider.iterator(0, size);
	while (iter.hasNext()) {
		resources.add(iter.next());
	}

	if (comparators != null) {
		SortParam<String> sortParam = getSort();
		if (sortParam != null) {
			String sortProperty = sortParam.getProperty();
			if (sortProperty != null) {
				Comparator<T> comparator = comparators.get(sortProperty);
				if (comparator != null) {
					Collections.sort(resources, comparator);
					if (getSort().isAscending() == false) {
						Collections.reverse(resources);
					}
				} else {
					SortDefinition sortDefinition = new MutableSortDefinition(sortProperty, true, getSort().isAscending());
					PropertyComparator.sort(resources, sortDefinition);
				}						
			}
		}
	}
	
	return Collections.unmodifiableList(resources.subList((int) first, (int) (first + count))).iterator();
}
 
Example 14
Source Project: spring-graalvm-native   Source File: Owner.java    License: Apache License 2.0 4 votes vote down vote up
public List<Pet> getPets() {
    List<Pet> sortedPets = new ArrayList<>(getPetsInternal());
    PropertyComparator.sort(sortedPets, new MutableSortDefinition("name", true, true));
    return Collections.unmodifiableList(sortedPets);
}
 
Example 15
Source Project: spring-graalvm-native   Source File: Pet.java    License: Apache License 2.0 4 votes vote down vote up
public List<Visit> getVisits() {
    List<Visit> sortedVisits = new ArrayList<>(getVisitsInternal());
    PropertyComparator.sort(sortedVisits, new MutableSortDefinition("date", false, false));
    return Collections.unmodifiableList(sortedVisits);
}
 
Example 16
Source Project: spring-graalvm-native   Source File: Vet.java    License: Apache License 2.0 4 votes vote down vote up
public List<Specialty> getSpecialties() {
    List<Specialty> sortedSpecs = new ArrayList<>(getSpecialtiesInternal());
    PropertyComparator.sort(sortedSpecs, new MutableSortDefinition("name", true, true));
    return Collections.unmodifiableList(sortedSpecs);
}
 
Example 17
Source Project: spring-graalvm-native   Source File: Owner.java    License: Apache License 2.0 4 votes vote down vote up
public List<Pet> getPets() {
	List<Pet> sortedPets = new ArrayList<>(getPetsInternal());
	PropertyComparator.sort(sortedPets, new MutableSortDefinition("name", true, true));
	return Collections.unmodifiableList(sortedPets);
}
 
Example 18
Source Project: spring-graalvm-native   Source File: Pet.java    License: Apache License 2.0 4 votes vote down vote up
public List<Visit> getVisits() {
	List<Visit> sortedVisits = new ArrayList<>(getVisitsInternal());
	PropertyComparator.sort(sortedVisits, new MutableSortDefinition("date", false, false));
	return Collections.unmodifiableList(sortedVisits);
}
 
Example 19
Source Project: spring-graalvm-native   Source File: Vet.java    License: Apache License 2.0 4 votes vote down vote up
@XmlElement
public List<Specialty> getSpecialties() {
	List<Specialty> sortedSpecs = new ArrayList<>(getSpecialtiesInternal());
	PropertyComparator.sort(sortedSpecs, new MutableSortDefinition("name", true, true));
	return Collections.unmodifiableList(sortedSpecs);
}
 
Example 20
Source Project: spring-init   Source File: Owner.java    License: Apache License 2.0 4 votes vote down vote up
public List<Pet> getPets() {
    List<Pet> sortedPets = new ArrayList<>(getPetsInternal());
    PropertyComparator.sort(sortedPets,
            new MutableSortDefinition("name", true, true));
    return Collections.unmodifiableList(sortedPets);
}
 
Example 21
Source Project: spring-init   Source File: Pet.java    License: Apache License 2.0 4 votes vote down vote up
public List<Visit> getVisits() {
    List<Visit> sortedVisits = new ArrayList<>(getVisitsInternal());
    PropertyComparator.sort(sortedVisits,
            new MutableSortDefinition("date", false, false));
    return Collections.unmodifiableList(sortedVisits);
}
 
Example 22
Source Project: amazon-ecs-java-microservices   Source File: Owner.java    License: Apache License 2.0 4 votes vote down vote up
public List<Pet> getPets() {
    List<Pet> sortedPets = new ArrayList<>(getPetsInternal());
    PropertyComparator.sort(sortedPets, new MutableSortDefinition("name", true, true));
    return Collections.unmodifiableList(sortedPets);
}
 
Example 23
Source Project: amazon-ecs-java-microservices   Source File: Pet.java    License: Apache License 2.0 4 votes vote down vote up
public List<Visit> getVisits() {
    List<Visit> sortedVisits = new ArrayList<>(getVisitsInternal());
    PropertyComparator.sort(sortedVisits,
            new MutableSortDefinition("date", false, false));
    return Collections.unmodifiableList(sortedVisits);
}
 
Example 24
Source Project: amazon-ecs-java-microservices   Source File: Owner.java    License: Apache License 2.0 4 votes vote down vote up
public List<Pet> getPets() {
    List<Pet> sortedPets = new ArrayList<>(getPetsInternal());
    PropertyComparator.sort(sortedPets, new MutableSortDefinition("name", true, true));
    return Collections.unmodifiableList(sortedPets);
}
 
Example 25
Source Project: amazon-ecs-java-microservices   Source File: Pet.java    License: Apache License 2.0 4 votes vote down vote up
public List<Visit> getVisits() {
    List<Visit> sortedVisits = new ArrayList<>(getVisitsInternal());
    PropertyComparator.sort(sortedVisits,
            new MutableSortDefinition("date", false, false));
    return Collections.unmodifiableList(sortedVisits);
}
 
Example 26
Source Project: amazon-ecs-java-microservices   Source File: Owner.java    License: Apache License 2.0 4 votes vote down vote up
public List<Pet> getPets() {
    List<Pet> sortedPets = new ArrayList<>(getPetsInternal());
    PropertyComparator.sort(sortedPets, new MutableSortDefinition("name", true, true));
    return Collections.unmodifiableList(sortedPets);
}
 
Example 27
Source Project: amazon-ecs-java-microservices   Source File: Pet.java    License: Apache License 2.0 4 votes vote down vote up
public List<Visit> getVisits() {
    List<Visit> sortedVisits = new ArrayList<>(getVisitsInternal());
    PropertyComparator.sort(sortedVisits,
            new MutableSortDefinition("date", false, false));
    return Collections.unmodifiableList(sortedVisits);
}
 
Example 28
Source Project: amazon-ecs-java-microservices   Source File: Owner.java    License: Apache License 2.0 4 votes vote down vote up
public List<Pet> getPets() {
    List<Pet> sortedPets = new ArrayList<>(getPetsInternal());
    PropertyComparator.sort(sortedPets, new MutableSortDefinition("name", true, true));
    return Collections.unmodifiableList(sortedPets);
}
 
Example 29
Source Project: amazon-ecs-java-microservices   Source File: Pet.java    License: Apache License 2.0 4 votes vote down vote up
public List<Visit> getVisits() {
    List<Visit> sortedVisits = new ArrayList<>(getVisitsInternal());
    PropertyComparator.sort(sortedVisits,
            new MutableSortDefinition("date", false, false));
    return Collections.unmodifiableList(sortedVisits);
}
 
Example 30
Source Project: amazon-ecs-java-microservices   Source File: Owner.java    License: Apache License 2.0 4 votes vote down vote up
public List<Pet> getPets() {
    List<Pet> sortedPets = new ArrayList<>(getPetsInternal());
    PropertyComparator.sort(sortedPets, new MutableSortDefinition("name", true, true));
    return Collections.unmodifiableList(sortedPets);
}