com.linkedin.restli.common
Class ResourceSpecImpl

java.lang.Object
  extended by com.linkedin.restli.common.ResourceSpecImpl
All Implemented Interfaces:
ResourceSpec

public class ResourceSpecImpl
extends java.lang.Object
implements ResourceSpec

Runtime representation of resource spec.


Constructor Summary
ResourceSpecImpl()
          Initialize an empty ResourceSpecImpl.
ResourceSpecImpl(java.util.Set<ResourceMethod> supportedMethods)
          Deprecated. builder should pass in actionRequestMetadata and actionResponseMetadata
ResourceSpecImpl(java.util.Set<ResourceMethod> supportedMethods, java.lang.Class<?> keyClass, java.lang.Class<? extends com.linkedin.data.template.RecordTemplate> keyKeyClass, java.lang.Class<? extends com.linkedin.data.template.RecordTemplate> keyParamsClass, java.lang.Class<? extends com.linkedin.data.template.RecordTemplate> valueClass, java.util.Map<java.lang.String,?> keyParts)
          Deprecated. builder should pass in actionRequestMetadata and actionResponseMetadata
ResourceSpecImpl(java.util.Set<ResourceMethod> supportedMethods, java.lang.Class<?> keyClass, java.lang.Class<? extends com.linkedin.data.template.RecordTemplate> valueClass, java.util.Map<java.lang.String,?> keyParts)
          Deprecated. builder should pass in actionRequestMetadata and actionResponseMetadata
ResourceSpecImpl(java.util.Set<ResourceMethod> supportedMethods, java.util.Map<java.lang.String,com.linkedin.data.template.DynamicRecordMetadata> actionRequestMetadata, java.util.Map<java.lang.String,com.linkedin.data.template.DynamicRecordMetadata> actionResponseMetadata)
          Initialize a ResourceSpecImpl with the given data.
ResourceSpecImpl(java.util.Set<ResourceMethod> supportedMethods, java.util.Map<java.lang.String,com.linkedin.data.template.DynamicRecordMetadata> actionRequestMetadata, java.util.Map<java.lang.String,com.linkedin.data.template.DynamicRecordMetadata> actionResponseMetadata, java.lang.Class<?> keyClass, java.lang.Class<? extends com.linkedin.data.template.RecordTemplate> keyKeyClass, java.lang.Class<? extends com.linkedin.data.template.RecordTemplate> keyParamsClass, java.lang.Class<? extends com.linkedin.data.template.RecordTemplate> valueClass, java.util.Map<java.lang.String,?> keyParts)
          Initialize a ResourceSpecImpl with the given data.
ResourceSpecImpl(java.util.Set<ResourceMethod> supportedMethods, java.util.Map<java.lang.String,com.linkedin.data.template.DynamicRecordMetadata> actionRequestMetadata, java.util.Map<java.lang.String,com.linkedin.data.template.DynamicRecordMetadata> actionResponseMetadata, java.lang.Class<?> keyClass, java.lang.Class<? extends com.linkedin.data.template.RecordTemplate> valueClass, java.util.Map<java.lang.String,?> keyParts)
          Initialize a ResourceSpecImpl with the given data.
ResourceSpecImpl(java.util.Set<ResourceMethod> supportedMethods, java.util.Map<java.lang.String,com.linkedin.data.template.DynamicRecordMetadata> actionRequestMetadata, java.util.Map<java.lang.String,com.linkedin.data.template.DynamicRecordMetadata> actionResponseMetadata, java.lang.Class<? extends com.linkedin.data.template.RecordTemplate> valueClass)
          Initialize a ResourceSpecImpl with the given data.
 
Method Summary
 boolean equals(java.lang.Object other)
           
 com.linkedin.data.template.DynamicRecordMetadata getActionResponseMetadata(java.lang.String methodName)
           
 java.lang.Class<?> getKeyClass()
           
 java.lang.Class<? extends com.linkedin.data.template.RecordTemplate> getKeyKeyClass()
           
 java.lang.Class<? extends com.linkedin.data.template.RecordTemplate> getKeyParamsClass()
           
 java.util.Map<java.lang.String,CompoundKey.TypeInfo> getKeyParts()
           
 com.linkedin.data.template.DynamicRecordMetadata getRequestMetadata(java.lang.String methodName)
           
 java.util.Set<ResourceMethod> getSupportedMethods()
           
 java.lang.Class<? extends com.linkedin.data.template.RecordTemplate> getValueClass()
           
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceSpecImpl

public ResourceSpecImpl()
Initialize an empty ResourceSpecImpl.


ResourceSpecImpl

@Deprecated
public ResourceSpecImpl(java.util.Set<ResourceMethod> supportedMethods)
Deprecated. builder should pass in actionRequestMetadata and actionResponseMetadata

Initialize a ResourceSpecImpl with the given data.

Parameters:
supportedMethods - Set of ResourceMethods supported

ResourceSpecImpl

public ResourceSpecImpl(java.util.Set<ResourceMethod> supportedMethods,
                        java.util.Map<java.lang.String,com.linkedin.data.template.DynamicRecordMetadata> actionRequestMetadata,
                        java.util.Map<java.lang.String,com.linkedin.data.template.DynamicRecordMetadata> actionResponseMetadata)
Initialize a ResourceSpecImpl with the given data.

Parameters:
supportedMethods - Set of ResourceMethods supported
actionRequestMetadata - Map from method name to method RecordDataSchema
actionResponseMetadata - Map from method name to response RecordDataSchema

ResourceSpecImpl

@Deprecated
public ResourceSpecImpl(java.util.Set<ResourceMethod> supportedMethods,
                                   java.lang.Class<?> keyClass,
                                   java.lang.Class<? extends com.linkedin.data.template.RecordTemplate> valueClass,
                                   java.util.Map<java.lang.String,?> keyParts)
Deprecated. builder should pass in actionRequestMetadata and actionResponseMetadata

Initialize a ResourceSpecImpl with the given data.

Parameters:
supportedMethods - Set of ResourceMethods supported
keyClass - type of the key of the Resource
valueClass - the type of the RecordTemplate the Resource manages
keyParts - Map of key names to key types (AssocKeyBindingTypes or, for backward compatibility, Class), if the keyClass is a CompoundKey.

ResourceSpecImpl

public ResourceSpecImpl(java.util.Set<ResourceMethod> supportedMethods,
                        java.util.Map<java.lang.String,com.linkedin.data.template.DynamicRecordMetadata> actionRequestMetadata,
                        java.util.Map<java.lang.String,com.linkedin.data.template.DynamicRecordMetadata> actionResponseMetadata,
                        java.lang.Class<?> keyClass,
                        java.lang.Class<? extends com.linkedin.data.template.RecordTemplate> valueClass,
                        java.util.Map<java.lang.String,?> keyParts)
Initialize a ResourceSpecImpl with the given data.

Parameters:
supportedMethods - Set of ResourceMethods supported
actionRequestMetadata - Map from method name to method RecordDataSchema
actionResponseMetadata - Map from method name to response RecordDataSchema
keyClass - type of the key of the Resource
valueClass - the type of the RecordTemplate the Resource manages
keyParts - Map of key names to key types (AssocKeyBindingTypes or, for backward compatibility, Class), if the keyClass is a CompoundKey.

ResourceSpecImpl

public ResourceSpecImpl(java.util.Set<ResourceMethod> supportedMethods,
                        java.util.Map<java.lang.String,com.linkedin.data.template.DynamicRecordMetadata> actionRequestMetadata,
                        java.util.Map<java.lang.String,com.linkedin.data.template.DynamicRecordMetadata> actionResponseMetadata,
                        java.lang.Class<? extends com.linkedin.data.template.RecordTemplate> valueClass)
Initialize a ResourceSpecImpl with the given data.

Parameters:
supportedMethods - Set of ResourceMethods supported
actionRequestMetadata - Map from method name to method RecordDataSchema
actionResponseMetadata - Map from method name to response RecordDataSchema
valueClass - the type of the RecordTemplate the Resource manages

ResourceSpecImpl

@Deprecated
public ResourceSpecImpl(java.util.Set<ResourceMethod> supportedMethods,
                                   java.lang.Class<?> keyClass,
                                   java.lang.Class<? extends com.linkedin.data.template.RecordTemplate> keyKeyClass,
                                   java.lang.Class<? extends com.linkedin.data.template.RecordTemplate> keyParamsClass,
                                   java.lang.Class<? extends com.linkedin.data.template.RecordTemplate> valueClass,
                                   java.util.Map<java.lang.String,?> keyParts)
Deprecated. builder should pass in actionRequestMetadata and actionResponseMetadata

Initialize a ResourceSpecImpl with the given data.

Parameters:
supportedMethods - Set of ResourceMethods supported
keyClass - type of the key of the Resource
keyKeyClass - RecordTemplate type of the key, if the keyClass is a ComplexResourceKey
keyParamsClass - RecordTemplate type of parameters of the key, if the keyClass is a ComplexResourceKey
valueClass - the type of the RecordTemplate that the Resource manages
keyParts - Map of key names to key types (AssocKeyBindingTypes or, for backward compatibility, Class), if the keyClass is a CompoundKey.

ResourceSpecImpl

public ResourceSpecImpl(java.util.Set<ResourceMethod> supportedMethods,
                        java.util.Map<java.lang.String,com.linkedin.data.template.DynamicRecordMetadata> actionRequestMetadata,
                        java.util.Map<java.lang.String,com.linkedin.data.template.DynamicRecordMetadata> actionResponseMetadata,
                        java.lang.Class<?> keyClass,
                        java.lang.Class<? extends com.linkedin.data.template.RecordTemplate> keyKeyClass,
                        java.lang.Class<? extends com.linkedin.data.template.RecordTemplate> keyParamsClass,
                        java.lang.Class<? extends com.linkedin.data.template.RecordTemplate> valueClass,
                        java.util.Map<java.lang.String,?> keyParts)
Initialize a ResourceSpecImpl with the given data.

Parameters:
supportedMethods - Set of ResourceMethods supported
actionRequestMetadata - Map from method name to method RecordDataSchema
actionResponseMetadata - Map from method name to response RecordDataSchema
keyClass - type of the key of the Resource, may be either a typeref or a primitive
keyKeyClass - RecordTemplate type of the key, if the keyClass is a ComplexResourceKey
keyParamsClass - RecordTemplate type of parameters of the key, if the keyClass is a ComplexResourceKey
valueClass - the type of the RecordTemplate that the Resource manages
keyParts - Map of key names to key types (AssocKeyBindingTypes or, for backward compatibility, Class), if the keyClass is a CompoundKey.
Method Detail

getSupportedMethods

public java.util.Set<ResourceMethod> getSupportedMethods()
Specified by:
getSupportedMethods in interface ResourceSpec
Returns:
the set of ResourceMethods supported by the Resource

getKeyClass

public java.lang.Class<?> getKeyClass()
Specified by:
getKeyClass in interface ResourceSpec
Returns:
the class of the key

getValueClass

public java.lang.Class<? extends com.linkedin.data.template.RecordTemplate> getValueClass()
Specified by:
getValueClass in interface ResourceSpec
Returns:
the RecordTemplate that the Resource Manages

getKeyParts

public java.util.Map<java.lang.String,CompoundKey.TypeInfo> getKeyParts()
Specified by:
getKeyParts in interface ResourceSpec
Returns:
the map of key names to key classes, if the keyClass is a CompoundKey

getKeyKeyClass

public java.lang.Class<? extends com.linkedin.data.template.RecordTemplate> getKeyKeyClass()
Specified by:
getKeyKeyClass in interface ResourceSpec
Returns:
the key of the key, if the keyClass is a ComplexResourceKey

getKeyParamsClass

public java.lang.Class<? extends com.linkedin.data.template.RecordTemplate> getKeyParamsClass()
Specified by:
getKeyParamsClass in interface ResourceSpec
Returns:
the parameters of the key, if the keyClass is a ComplexResourceKey

getRequestMetadata

public com.linkedin.data.template.DynamicRecordMetadata getRequestMetadata(java.lang.String methodName)
Specified by:
getRequestMetadata in interface ResourceSpec
Parameters:
methodName - the name of the method
Returns:
the DynamicRecordMetadata of the method

getActionResponseMetadata

public com.linkedin.data.template.DynamicRecordMetadata getActionResponseMetadata(java.lang.String methodName)
Specified by:
getActionResponseMetadata in interface ResourceSpec
Parameters:
methodName - the name of the method
Returns:
the DynamicRecordMetadata of the Response

equals

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

hashCode

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