com.atlassian.mywork.util
Class GlobalIdFactory

java.lang.Object
  extended by com.atlassian.mywork.util.GlobalIdFactory

public class GlobalIdFactory
extends java.lang.Object

Factory for encoding and decoding globalIds.


Constructor Summary
GlobalIdFactory()
           
 
Method Summary
static java.util.Map<java.lang.String,java.lang.String> decode(java.lang.String globalId, java.util.List<java.lang.String> keys)
          Decode the given String to a Map of values.
static java.lang.String encode(java.util.List<java.lang.String> keys, java.util.Map<java.lang.String,java.lang.String> values)
          Encode the given Map of values to a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlobalIdFactory

public GlobalIdFactory()
Method Detail

encode

public static java.lang.String encode(java.util.List<java.lang.String> keys,
                                      java.util.Map<java.lang.String,java.lang.String> values)
Encode the given Map of values to a String.

Parameters:
keys - the order in which the keys will be appended to the result
values - the values to encode as a String
Returns:
a String

decode

public static java.util.Map<java.lang.String,java.lang.String> decode(java.lang.String globalId,
                                                                      java.util.List<java.lang.String> keys)
Decode the given String to a Map of values.

Parameters:
globalId - the String to decode
keys - the order in which the keys should appear. If the keys are not in this order an IllegalArgumentException is thrown.
Returns:
a Map of values


Copyright © 2012 Atlassian. All Rights Reserved.