Class SourceIdentifier
- java.lang.Object
-
- org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier
-
- All Implemented Interfaces:
Serializable
,Identifier
,Immutable
,MutationBehaviour<Immutable>
- Direct Known Subclasses:
RevisionSourceIdentifier
,SemVerSourceIdentifier
@Beta public abstract class SourceIdentifier extends Object implements Identifier, Immutable
Base class of YANG Schema source identifiers. Source identifiers are designated to be carry only necessary information to look up YANG module (or submodule) source and to be used by various SchemaSourceProviders.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NonNull String
getName()
Returns model name.Optional<Revision>
getRevision()
Returns revision of source or null if revision was not supplied.@NonNull SourceIdentifier
intern()
Return an interned reference to a equivalent SemVerSourceIdentifier.@NonNull String
toYangFilename()
Returns filename for this YANG module as specified in RFC 6020.static @NonNull String
toYangFileName(String moduleName, Optional<Revision> revision)
Returns filename for this YANG module as specified in RFC 6020.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opendaylight.yangtools.concepts.Identifier
equals, hashCode, toString
-
-
-
-
Method Detail
-
intern
public @NonNull SourceIdentifier intern()
Return an interned reference to a equivalent SemVerSourceIdentifier.- Returns:
- Interned reference, or this object if it was interned.
-
getName
public @NonNull String getName()
Returns model name.- Returns:
- model name
-
getRevision
public Optional<Revision> getRevision()
Returns revision of source or null if revision was not supplied.- Returns:
- revision of source or null if revision was not supplied.
-
toYangFilename
public @NonNull String toYangFilename()
Returns filename for this YANG module as specified in RFC 6020.Returns filename in format
name ['@' revision] '.yang'
, where revision is date in format YYYY-mm-dd.- Returns:
- Filename for this source identifier.
- See Also:
- RFC6020
-
toYangFileName
public static @NonNull String toYangFileName(String moduleName, Optional<Revision> revision)
Returns filename for this YANG module as specified in RFC 6020.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
- Parameters:
moduleName
- module namerevision
- optional revision- Returns:
- Filename for this source identifier.
-
-