Merge branch 'master' of ../controller
[yangtools.git] / common / concepts / src / main / java / org / opendaylight / yangtools / concepts / Identifiable.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.yangtools.concepts;
9
10 import org.eclipse.jdt.annotation.NonNull;
11
12 /**
13  * A generalized contract of an object which has an identifier. The identifier, unlike the object carrying it, must
14  * generally comply to the interface contract outlined in {@link Identifier}, but this is not enforced in this API's
15  * design, as there are external classes, such as {@link String}, which comply to the contract without implementing it.
16  *
17  * @param <T> Identifier class, must conform to API contract outlined by {@link Identifier}, even if it does not
18  *            implement it.
19  */
20 // FIXME: 5.0.0: consider requiring "T extends Serializable"
21 public interface Identifiable<T> {
22     /**
23      * Return this objects Identifier.
24      *
25      * @return Object's identifier, must not be null.
26      */
27     @NonNull T getIdentifier();
28 }