Permalink
Browse files

making ordering extensible

  • Loading branch information...
lucascs committed Aug 12, 2011
1 parent 51e8b5f commit 58535af3c904aa2819fcc827eb8bb4aed5cf0405
@@ -43,14 +43,23 @@ public DefaultRepresentationResult(FormatResolver formatResolver, Result result,
this.formatResolver = formatResolver;
this.result = result;
this.serializations = serializations;
Collections.sort(this.serializations, new PackageComparator());
sortSerializations();
this.headersHandler = headersHandler;
}
public <T> Serializer from(T object) {
return from(object, null);
}
/**
* Override this method if you want another ordering strategy.
*
* @since 3.4.0
*/
protected void sortSerializations() {
Collections.sort(this.serializations, new PackageComparator());
}
public <T> Serializer from(T object, String alias) {
if(object == null) {
result.use(status()).notFound();

0 comments on commit 58535af

Please sign in to comment.