library/src/main/java/com/kdgregory/aws/utils/kinesis/KinesisUtil.java
/**
     *  A utility function that transforms a list of shards into a map of
     *  shards keyed by their parent ID. This is used internally and may
     *  be generally useful.
     */
A utility function that transforms a list of shards into a map of
shards keyed by their parent ID. This is used internally and may
be generally useful.
A utility function that transforms a list of shards into a map of shards keyed by their parent ID . This is used internally and may be generally useful .
public static Map<String,List<Shard>> toMapByParentId(Collection<Shard> shards)
    {
        Map<String,List<Shard>> result = new HashMap<String,List<Shard>>();
        for (Shard shard : shards)
        {
            List<Shard> children = result.get(shard.getParentShardId());
            if (children == null)
            {
                children = new ArrayList<Shard>();
                result.put(shard.getParentShardId(), children);
            }
            children.add(shard);
        }
        return result;
    }
public static Map < String , List < Shard > > toMapByParentId ( Collection < Shard > shards ) { Map < String , List < Shard > > result = new HashMap < String , List < Shard > > ( ) ; for ( Shard shard : shards ) { List < Shard > children = result . get ( shard . getParentShardId ( ) ) ; if ( children == null ) { children = new ArrayList < Shard > ( ) ; result . put ( shard . getParentShardId ( ) , children ) ; } children . add ( shard ) ; } return result ; }
A utility function that transforms a list of shards into a map of
  shards keyed by their parent ID.
A utility function that transforms a list of shards into a map of shards keyed by their parent ID .