Sho SHIMIZU | 7cd8a42 | 2014-08-27 16:05:21 -0700 | [diff] [blame] | 1 | package net.onrc.onos.core.util; |
| 2 | |
| 3 | /** |
| 4 | * A generalized interface for ID generation |
| 5 | * |
| 6 | * {@link #getNewId()} generates a globally unique ID instance on |
| 7 | * each invocation. |
| 8 | * |
| 9 | * @param <T> the type of ID |
| 10 | */ |
| 11 | // TODO: do we need to define a base marker interface for ID, |
| 12 | // then changed the type parameter to <T extends BaseId> something |
| 13 | // like that? |
| 14 | public interface IdGenerator<T> { |
| 15 | /** |
| 16 | * Returns a globally unique ID instance. |
| 17 | * |
| 18 | * @return globally unique ID instance |
| 19 | */ |
| 20 | T getNewId(); |
| 21 | } |