Groovy Documentation

org.linkedin.glu.orchestration.engine.delta.impl
[Java] Class DeltaUtils

java.lang.Object
  org.linkedin.glu.orchestration.engine.delta.impl.DeltaUtils

public class DeltaUtils

Authors:
yan@pongasoft.com


Nested Class Summary
static class DeltaUtils.AscDeltaRowComparator

static class DeltaUtils.DescDeltaRowComparator

 
Field Summary
static java.util.Map delatRowsComparators

 
Method Summary
static void sortBy(java.util.List list, java.util.Map orderBy)

The purpose of this method is to sort the rows in the delta when 'summary' is turned off.

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Field Detail

delatRowsComparators

public static java.util.Map delatRowsComparators


 
Method Detail

sortBy

@SuppressWarnings("unchecked")
public static void sortBy(java.util.List list, java.util.Map orderBy)
The purpose of this method is to sort the rows in the delta when 'summary' is turned off. Example:
   c1 | c2 | c3
   ---+----+---
   1  | 2  | 3
   3  | 1  | 2
 
This 'table' would be represented as (groovy notation) (list param): [[c1: 1, c2: 2, c3: 3], [c1: 3, c2: 1, c3: 2]] orderBy would be represented as [c1: 'asc', c2: 'desc', c3: null] which would mean: use c1 in ascending order first and if they are equal then use c2 in descending order and ignore c3.
Parameters:
list - each element in the list is a row (a map where the key is the name of the column and the value is the value of the cell)
orderBy - is a map where the key is the name of the column and the value is defined in CustomDeltaColumnDefinition. The order in which the map is iterated is *very* important so it should obviously be of type LinkedHashMap...


 

Groovy Documentation