*/
package org.opendaylight.yangtools.yang.model.api;
-import java.net.URI;
import java.util.Date;
import java.util.Optional;
-import org.opendaylight.yangtools.concepts.SemVer;
import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
/**
*/
String getName();
- /**
- * Returns the namespace of the module which is specified as argument of
- * YANG {@link Module <b><font color="#00FF00">namespace</font></b>}
- * keyword.
- *
- * @return URI format of the namespace of the module
- */
- // FIXME: this should not be here
- URI getNamespace();
-
/**
* Returns the revision date for the module.
*
* keyword
*/
// FIXME: BUG-4688: should return Optional<Revision>
- // FIXME: this should not be here
- Date getRevision();
+ Optional<Date> getRevision();
- /**
- * Returns the semantic version of YANG module.
- *
- * <p>
- * If the semantic version is not specified, default semantic version of
- * module is returned.
- *
- * @return SemVer semantic version of yang module which is specified as
- * argument of
- * (urn:opendaylight:yang:extension:semantic-version?revision
- * =2016-02-02)semantic-version statement
- */
- // FIXME: this should not be here
- Optional<SemVer> getSemanticVersion();
+ static int compareRevisions(final Optional<Date> first, final Optional<Date> second) {
+ if (!first.isPresent()) {
+ return second.isPresent() ? -1 : 0;
+ }
+ return second.isPresent() ? first.get().compareTo(second.get()) : 1;
+ }
}