# com.beasys.commerce.foundation
SmartKey Class

public abstract class SmartKey
extends `Object`
implements `Comparable`, `Serializable`

For each Entity there must be a primary key class derived from SmartKey. Implementing SmartKey requires that the classes be serializable and comparable.

Related Topics

``Entity``

Hierarchy
  `Object`
  `SmartKey`

All Implemented Interfaces
  `Comparable`, `Serializable`

Direct Known Subclasses
  `ContactPk`, `OrderPk`, `PaymentTransactionPk`, `ShippingMethodPk`

## Constructor Summary

SmartKey() Default constructor.

## Method Summary

`public abstract int` | `compareTo`(`Object` o) Compares a given object with this SmartKey.
`public boolean` | `equals`(`Object` o) Indicates whether some other Object is equivalent to this SmartKey.
`public `String`` | `toString`() Returns a `String` representation of the SmartKey.

Methods from class `java.lang.`Object``
`clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods from interface `java.lang.`Comparable``
`compareTo`

## Constructor Detail

### SmartKey

    public SmartKey()

  Default constructor.

## Method Detail

### compareTo(Object) Method

    public abstract int compareTo(Object o)

Compares a given object with this SmartKey.

#### Parameters

o
  the Object to be compared.

#### Returns

a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

### equals(Object) Method

    public boolean equals(Object o)

Indicates whether some other Object is equivalent to this SmartKey.

Overrides
  `Object.equals(Object)`

#### Parameters

o
  the Object to be compared.

#### Returns

`true` if the supplied Object is equivalent, `false` otherwise.

### toString() Method

    public String toString()

Returns a `String` representation of the SmartKey.

Overrides
  `Object.toString()`

#### Returns

A `String` representation of the SmartKey.