Search in sources :

Example 1 with MutableSortDefinition

use of org.springframework.beans.support.MutableSortDefinition in project spring-petclinic by spring-projects.

the class Pet method getVisits.

public List<Visit> getVisits() {
    List<Visit> sortedVisits = new ArrayList<>(getVisitsInternal());
    PropertyComparator.sort(sortedVisits, new MutableSortDefinition("date", false, false));
    return Collections.unmodifiableList(sortedVisits);
}
Also used : MutableSortDefinition(org.springframework.beans.support.MutableSortDefinition) Visit(org.springframework.samples.petclinic.visit.Visit) ArrayList(java.util.ArrayList)

Example 2 with MutableSortDefinition

use of org.springframework.beans.support.MutableSortDefinition in project spring-petclinic by spring-projects.

the class Vet method getSpecialties.

@XmlElement
public List<Specialty> getSpecialties() {
    List<Specialty> sortedSpecs = new ArrayList<>(getSpecialtiesInternal());
    PropertyComparator.sort(sortedSpecs, new MutableSortDefinition("name", true, true));
    return Collections.unmodifiableList(sortedSpecs);
}
Also used : MutableSortDefinition(org.springframework.beans.support.MutableSortDefinition) ArrayList(java.util.ArrayList) XmlElement(javax.xml.bind.annotation.XmlElement)

Example 3 with MutableSortDefinition

use of org.springframework.beans.support.MutableSortDefinition in project spring-petclinic by spring-projects.

the class Owner method getPets.

public List<Pet> getPets() {
    List<Pet> sortedPets = new ArrayList<>(getPetsInternal());
    PropertyComparator.sort(sortedPets, new MutableSortDefinition("name", true, true));
    return Collections.unmodifiableList(sortedPets);
}
Also used : MutableSortDefinition(org.springframework.beans.support.MutableSortDefinition) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)3 MutableSortDefinition (org.springframework.beans.support.MutableSortDefinition)3 XmlElement (javax.xml.bind.annotation.XmlElement)1 Visit (org.springframework.samples.petclinic.visit.Visit)1