@Beta public abstract class SourceIdentifier extends Object implements Identifier, Immutable
Source identifiers are designated to be carry only necessary information to look-up YANG model source and to be used by various SchemaSourceProviders.
(For further reference see: http://tools.ietf.org/html/rfc6020#section-5.2 and http://tools.ietf.org/html/rfc6022#section-3.1 ).
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)
moduleName
- Name of schemarevision
- Revision of source in format YYYY-mm-dd. If not present,
default value will be used.public String toYangFilename()
Returns filename in format 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)
Returns filename in format 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.