org.springframework.beans.support.PropertyComparator Java Examples

The following examples show how to use org.springframework.beans.support.PropertyComparator. 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: Vet.java    From amazon-ecs-java-microservices with 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 File: Vet.java    From spring-init with 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 File: Vet.java    From amazon-ecs-java-microservices with 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 File: Vet.java    From amazon-ecs-java-microservices with 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 File: Vet.java    From amazon-ecs-java-microservices with 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 File: Vet.java    From amazon-ecs-java-microservices with 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 File: Vet.java    From amazon-ecs-java-microservices with 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 File: Vet.java    From amazon-ecs-java-microservices with 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 File: SortableDataAdapter.java    From nextreports-server with 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 #10
Source File: Vet.java    From amazon-ecs-java-microservices with 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 File: Vet.java    From amazon-ecs-java-microservices with 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 File: Vet.java    From amazon-ecs-java-microservices with 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 File: Vet.java    From amazon-ecs-java-microservices with 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 #14
Source File: Owner.java    From DevOps-for-Web-Development with MIT License 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 File: Vet.java    From docker-workflow-plugin with MIT License 4 votes vote down vote up
@XmlElement
public List<Specialty> getSpecialties() {
    List<Specialty> sortedSpecs = new ArrayList<Specialty>(getSpecialtiesInternal());
    PropertyComparator.sort(sortedSpecs, new MutableSortDefinition("name", true, true));
    return Collections.unmodifiableList(sortedSpecs);
}
 
Example #16
Source File: Pet.java    From docker-workflow-plugin with MIT License 4 votes vote down vote up
public List<Visit> getVisits() {
    List<Visit> sortedVisits = new ArrayList<Visit>(getVisitsInternal());
    PropertyComparator.sort(sortedVisits, new MutableSortDefinition("date", false, false));
    return Collections.unmodifiableList(sortedVisits);
}
 
Example #17
Source File: Owner.java    From docker-workflow-plugin with MIT License 4 votes vote down vote up
public List<Pet> getPets() {
    List<Pet> sortedPets = new ArrayList<Pet>(getPetsInternal());
    PropertyComparator.sort(sortedPets, new MutableSortDefinition("name", true, true));
    return Collections.unmodifiableList(sortedPets);
}
 
Example #18
Source File: Vet.java    From audit4j-demo with Apache License 2.0 4 votes vote down vote up
@XmlElement
public List<Specialty> getSpecialties() {
    List<Specialty> sortedSpecs = new ArrayList<Specialty>(getSpecialtiesInternal());
    PropertyComparator.sort(sortedSpecs, new MutableSortDefinition("name", true, true));
    return Collections.unmodifiableList(sortedSpecs);
}
 
Example #19
Source File: Owner.java    From DevOps-for-Web-Development with MIT License 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 #20
Source File: Pet.java    From enhanced-pet-clinic with Apache License 2.0 4 votes vote down vote up
public List<Visit> getVisits() {
	List<Visit> sortedVisits = new ArrayList<Visit>(getVisitsInternal());
	PropertyComparator.sort(sortedVisits, new MutableSortDefinition("date", false, false));
	return Collections.unmodifiableList(sortedVisits);
}
 
Example #21
Source File: Vet.java    From DevOps-for-Web-Development with MIT License 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 #22
Source File: Pet.java    From DevOps-for-Web-Development with MIT License 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 #23
Source File: Vet.java    From activejpa with Apache License 2.0 4 votes vote down vote up
@XmlElement
public List<Specialty> getSpecialties() {
    List<Specialty> sortedSpecs = new ArrayList<Specialty>(getSpecialtiesInternal());
    PropertyComparator.sort(sortedSpecs, new MutableSortDefinition("name", true, true));
    return Collections.unmodifiableList(sortedSpecs);
}
 
Example #24
Source File: Vet.java    From DevOps-for-Web-Development with MIT License 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 #25
Source File: Owner.java    From activejpa with Apache License 2.0 4 votes vote down vote up
public List<Pet> getPets() {
    List<Pet> sortedPets = new ArrayList<Pet>(getPetsInternal());
    PropertyComparator.sort(sortedPets, new MutableSortDefinition("name", true, true));
    return Collections.unmodifiableList(sortedPets);
}
 
Example #26
Source File: Pet.java    From amazon-ecs-java-microservices with 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 #27
Source File: Owner.java    From amazon-ecs-java-microservices with 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 #28
Source File: Pet.java    From activejpa with Apache License 2.0 4 votes vote down vote up
public List<Visit> getVisits() {
    List<Visit> sortedVisits = new ArrayList<Visit>(getVisitsInternal());
    PropertyComparator.sort(sortedVisits, new MutableSortDefinition("date", false, false));
    return Collections.unmodifiableList(sortedVisits);
}
 
Example #29
Source File: Pet.java    From amazon-ecs-java-microservices with 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 File: Owner.java    From enhanced-pet-clinic with Apache License 2.0 4 votes vote down vote up
public List<Pet> getPets() {
	List<Pet> sortedPets = new ArrayList<Pet>(getPetsInternal());
	PropertyComparator.sort(sortedPets, new MutableSortDefinition("name", true, true));
	return Collections.unmodifiableList(sortedPets);
}