com.mapinfo.midev.feature

## Class PrimaryKeyMetadata

- java.lang.Object
- - com.mapinfo.midev.feature.PrimaryKeyMetadata

All Implemented Interfaces:
  Serializable

    public final class PrimaryKeyMetadata
    extends Object
    implements Serializable

Metadata that describes the primary key of an `IDataSourceTable` or `IFeature`.

See Also:
  Serialized Form

### Field Summary

Fields
`static PrimaryKeyMetadata` `NONE` Constant for indicating that the data has no primary key.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static PrimaryKeyMetadata` `create(KeyType keyType, IAttributeDefinition attribute)` Returns a `PrimaryKeyMetadata` that is of the specified type composed of the specified attributes (columns).
`static PrimaryKeyMetadata` `create(KeyType keyType, List attributes)` Returns a `PrimaryKeyMetadata` that is of the specified type composed of the specified attributes (columns).
`boolean` `equals(Object o)`
`List` `getAttributes()` Returns the attributes that compose the key.
`KeyType` `getKeyType()` Returns the type of key.
`int` `hashCode()`

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### NONE

    public static final PrimaryKeyMetadata NONE

Constant for indicating that the data has no primary key.

### Method Detail

#### create

    public static PrimaryKeyMetadata create(KeyType keyType,
                                            IAttributeDefinition attribute)

Returns a `PrimaryKeyMetadata` that is of the specified type composed of the specified attributes (columns).

Parameters:
  `keyType` - the type of key.
  `attribute` - the attributes that compose the key.
Returns:
  a `PrimaryKeyMetadata` that is of the specified type composed of the specified attributes (columns).

#### create

    public static PrimaryKeyMetadata create(KeyType keyType,
                                            List attributes)

Returns a `PrimaryKeyMetadata` that is of the specified type composed of the specified attributes (columns).

Parameters:
  `keyType` - the type of key.
  `attributes` - the attributes that compose the key.
Returns:
  a `PrimaryKeyMetadata` that is of the specified type composed of the specified attributes (columns).

#### getKeyType

    public KeyType getKeyType()

Returns the type of key.

Returns:
  the type of key.

#### getAttributes

    public List getAttributes()

Returns the attributes that compose the key. Will never be null but may be empty and will be immutable.

Returns:
  the attributes that compose the key.

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`