Package ubic.gemma.persistence.util
Class Sort
- java.lang.Object
-
- ubic.gemma.persistence.util.Sort
-
- All Implemented Interfaces:
PropertyMapping
public class Sort extends Object implements PropertyMapping
Represents a directed sort by a property.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Sort.Direction
Direction of the sort.static class
Sort.NullMode
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Sort
andThen(Sort andThen)
Add a next sort.static Sort
by(String alias, String propertyName, Sort.Direction direction, Sort.NullMode nullMode)
Create a sort without an original property.static Sort
by(String alias, String propertyName, Sort.Direction direction, Sort.NullMode nullMode, String originalProperty)
Create aSort
for a given alias, property and direction.String
toOriginalString()
Render this with its original property.String
toString()
Render this with itsPropertyMapping.getObjectAlias()
andPropertyMapping.getPropertyName()
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ubic.gemma.persistence.util.PropertyMapping
getObjectAlias, getOriginalProperty, getPropertyName
-
-
-
-
Method Detail
-
by
public static Sort by(@Nullable String alias, String propertyName, @Nullable Sort.Direction direction, Sort.NullMode nullMode, String originalProperty)
Create aSort
for a given alias, property and direction.- Parameters:
alias
- an alias in the query, or null to refer to the root entity (not recommended though, since this could result in an ambiguous query)propertyName
- a property of objectAlias to order bydirection
- a direction, or null for defaultoriginalProperty
- an original property name for rendering viatoOriginalString()
-
by
public static Sort by(@Nullable String alias, String propertyName, @Nullable Sort.Direction direction, Sort.NullMode nullMode)
Create a sort without an original property.- See Also:
by(String, String, Direction, NullMode)
-
toString
public String toString()
Description copied from interface:PropertyMapping
Render this with itsPropertyMapping.getObjectAlias()
andPropertyMapping.getPropertyName()
.- Specified by:
toString
in interfacePropertyMapping
- Overrides:
toString
in classObject
-
toOriginalString
public String toOriginalString()
Description copied from interface:PropertyMapping
Render this with its original property.If no original property are attached to this mapping, this method should return the same as
PropertyMapping.toString()
.- Specified by:
toOriginalString
in interfacePropertyMapping
-
-