com.linkedin.restli.common
Class CompoundKey

java.lang.Object
  extended by com.linkedin.restli.common.CompoundKey

public class CompoundKey
extends java.lang.Object

Represents a compound identifier.


Nested Class Summary
static class CompoundKey.TypeInfo
           
 
Constructor Summary
CompoundKey()
           
 
Method Summary
 CompoundKey append(java.lang.String name, java.lang.Object value)
          Add the key with the given name and value to the CompoundKey.
 boolean equals(java.lang.Object obj)
           
static CompoundKey fromValues(com.linkedin.data.DataMap fieldValues, java.util.Map<java.lang.String,CompoundKey.TypeInfo> fieldTypes)
          Initialize and return a CompoundKey.
 int getNumParts()
           
 java.lang.Object getPart(java.lang.String name)
          Get the Object associated with the given key name.
 java.lang.Integer getPartAsInt(java.lang.String name)
          Get the Object associated with the given key name as an Integer.
 java.lang.Long getPartAsLong(java.lang.String name)
          Get the Object associated with the given key name as a Long.
 java.lang.String getPartAsString(java.lang.String name)
          Get the Object associated with the given key name as a String.
 java.util.Set<java.lang.String> getPartKeys()
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompoundKey

public CompoundKey()
Method Detail

fromValues

public static CompoundKey fromValues(com.linkedin.data.DataMap fieldValues,
                                     java.util.Map<java.lang.String,CompoundKey.TypeInfo> fieldTypes)
Initialize and return a CompoundKey.

Parameters:
fieldValues - DataMap representing the CompoundKey
fieldTypes - Map of key name to it's CompoundKey.TypeInfo (also accepts Class for backward compatibility).
Returns:
a CompoundKey

append

public CompoundKey append(java.lang.String name,
                          java.lang.Object value)
Add the key with the given name and value to the CompoundKey.

Parameters:
name - name of the key
value - value of the key
Returns:
this

getPart

public java.lang.Object getPart(java.lang.String name)
Get the Object associated with the given key name.

Parameters:
name - name of the key
Returns:
an Object

getPartAsInt

public java.lang.Integer getPartAsInt(java.lang.String name)
Get the Object associated with the given key name as an Integer.

Parameters:
name - name of the key
Returns:
an Integer

getPartAsLong

public java.lang.Long getPartAsLong(java.lang.String name)
Get the Object associated with the given key name as a Long.

Parameters:
name - name of the key
Returns:
a Long

getPartAsString

public java.lang.String getPartAsString(java.lang.String name)
Get the Object associated with the given key name as a String.

Parameters:
name - name of the key
Returns:
a String

getNumParts

public int getNumParts()
Returns:
the number of keys in this CompoundKey

getPartKeys

public java.util.Set<java.lang.String> getPartKeys()
Returns:
a set of all the key names in this CompoundKey

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object