public interface Identifiable extends Serializable
Storages somehow
need to be identified. Therefore the minimal requirement is to have a way to
distinguish entities. Some implementations of Storage might not need
to rely on having persisted instances implement this interface (e.g.
JPA-based implementations).
It'd also be possible to enforce implementation of #hashCode() , but
that's troublesome and provide a getId() isn't too much to ask.
Implements Serializable because there's no case where you'd want to
have an Identifiable which you don't want to serialize.| Modifier and Type | Method and Description |
|---|---|
Long |
getId() |
Long getId()
Copyright © 2018. All rights reserved.