2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.yangtools.yang.model.api;
10 import java.util.Date;
11 import java.util.Optional;
12 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
15 * Module identifier. This "identifier" is deprecated and is to be removed in 2.0.0.
16 * @author Robert Varga
18 * @deprecated Use {@link SourceIdentifier} instead.
21 public interface ModuleIdentifier {
23 * Returns the name of the module which is specified as argument of YANG
24 * {@link Module <b><font color="#FF0000">module</font></b>} keyword.
26 * @return string with the name of the module
31 * Returns the revision date for the module.
33 * @return date of the module revision which is specified as argument of
34 * YANG {@link Module <b><font color="#339900">revison</font></b>}
37 // FIXME: BUG-4688: should return Optional<Revision>
38 Optional<Date> getRevision();
40 static int compareRevisions(final Optional<Date> first, final Optional<Date> second) {
41 if (!first.isPresent()) {
42 return second.isPresent() ? -1 : 0;
44 return second.isPresent() ? first.get().compareTo(second.get()) : 1;