@Beta public abstract class SourceIdentifier extends Object implements Identifier, Immutable
Modifier and Type | Field and Description |
---|---|
static String |
NOT_PRESENT_FORMATTED_REVISION
Default revision for sources without specified revision.
|
static Pattern |
REVISION_PATTERN
Simplified compiled revision pattern in format YYYY-mm-dd, which checks
only distribution of number elements.
|
Modifier and Type | Method and Description |
---|---|
static SourceIdentifier |
create(String moduleName,
com.google.common.base.Optional<String> revision)
|
String |
getName()
Returns model name
|
String |
getRevision()
Returns revision of source or null if revision was not supplied.
|
SourceIdentifier |
intern()
Return an interned reference to a equivalent SemVerSourceIdentifier.
|
String |
toYangFilename()
Returns filename for this YANG module as specified in RFC 6020.
|
static String |
toYangFileName(String moduleName,
com.google.common.base.Optional<String> revision)
Returns filename for this YANG module as specified in RFC 6020.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, hashCode, toString
public static final String NOT_PRESENT_FORMATTED_REVISION
public static final Pattern REVISION_PATTERN
For checking if supplied string is real date, use
SimpleDateFormatUtil
instead.
public SourceIdentifier intern()
public String getName()
public String getRevision()
@Deprecated public static SourceIdentifier create(String moduleName, com.google.common.base.Optional<String> revision)
Since we've got two ways of model versioning (revision & semantic version), this method shouldn't be called directly anymore. Eventually, callers of this method should be notified before method gets deleted.
moduleName
- Name of schemarevision
- Revision of source in format YYYY-mm-dd. If not present,
default value will be used.public String toYangFilename()
name ['@' revision] '.yang'
Where revision is date in format YYYY-mm-dd.
public static String toYangFileName(String moduleName, com.google.common.base.Optional<String> revision)
moduleName ['@' revision] '.yang'
Where Where revision-date is in format YYYY-mm-dd.
See http://tools.ietf.org/html/rfc6020#section-5.2
Copyright © 2018 OpenDaylight. All rights reserved.