org.eclipse.datatools.connectivity.oda.spec
Class QuerySpecification.ParameterIdentifier

java.lang.Object
  extended by org.eclipse.datatools.connectivity.oda.spec.QuerySpecification.ParameterIdentifier
Enclosing class:
QuerySpecification

public class QuerySpecification.ParameterIdentifier
extends java.lang.Object

The identifier of a data set query parameter, defined by its native name and/or id (1-based).
A name if specified takes precedence over its specified id. This may be used as an unique key in a Map. Comparison by name is case-sensitive.


Constructor Summary
QuerySpecification.ParameterIdentifier(int paramId)
          Creates a parameter identifier with its id.
QuerySpecification.ParameterIdentifier(java.lang.String paramName)
          Creates a parameter identifier with its native name.
QuerySpecification.ParameterIdentifier(java.lang.String paramName, int paramId)
          Creates a parameter identifier with both its native name and id.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.Integer getParameterId()
          Gets the parameter id, if specified.
 java.lang.String getParameterName()
          Gets the parameter's native name, if specified.
 int hashCode()
           
 boolean hasId()
          Indicates whether this has an 1-based id.
 boolean hasName()
          Indicates whether this has a native name.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QuerySpecification.ParameterIdentifier

public QuerySpecification.ParameterIdentifier(java.lang.String paramName)
Creates a parameter identifier with its native name.

Parameters:
paramName - native name of the parameter
Throws:
java.lang.IllegalArgumentException - if specified argument is null or empty

QuerySpecification.ParameterIdentifier

public QuerySpecification.ParameterIdentifier(int paramId)
Creates a parameter identifier with its id.

Parameters:
paramId - id of the parameter (1-based)
Throws:
java.lang.IllegalArgumentException - if specified argument is not greater or equal to 1

QuerySpecification.ParameterIdentifier

public QuerySpecification.ParameterIdentifier(java.lang.String paramName,
                                              int paramId)
Creates a parameter identifier with both its native name and id.

Parameters:
paramName - native name of the parameter
paramId - id of the parameter (1-based)
Method Detail

getParameterId

public java.lang.Integer getParameterId()
Gets the parameter id, if specified.

Returns:
parameter id, or null if not specified

getParameterName

public java.lang.String getParameterName()
Gets the parameter's native name, if specified.

Returns:
parameter's native name, or null if not specified

hasName

public boolean hasName()
Indicates whether this has a native name.

Returns:
true if a native name exists; false otherwise

hasId

public boolean hasId()
Indicates whether this has an 1-based id.

Returns:
true if an id exists; false otherwise

equals

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

hashCode

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

toString

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