Class RevisionSourceIdentifier
- java.lang.Object
-
- org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier
-
- org.opendaylight.yangtools.yang.model.repo.api.RevisionSourceIdentifier
-
- All Implemented Interfaces:
Serializable
,Identifier
,Immutable
,MutationBehaviour<Immutable>
@Beta public final class RevisionSourceIdentifier extends SourceIdentifier
YANG Schema revision source identifier.Simple transfer object represents revision identifier of source for YANG schema (module or submodule), which consists of
- YANG schema name (
SourceIdentifier.getName()
- Module revision (optional) ({link
SourceIdentifier.getRevision()
)
Revision source identifier is designated to be carry only necessary information to look-up YANG model source and to be used by various SchemaSourceProviders.
Note:On source retrieval layer it is impossible to distinguish between YANG module and/or submodule unless source is present.
(For further reference see: http://tools.ietf.org/html/rfc6020#section-5.2 and http://tools.ietf.org/html/rfc6022#section-3.1 ).
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static @NonNull RevisionSourceIdentifier
create(String moduleName)
Creates new YANG Schema revision source identifier for sources without a revision.static @NonNull RevisionSourceIdentifier
create(String moduleName, @Nullable Revision revision)
Creates new YANG Schema revision source identifier.static @NonNull RevisionSourceIdentifier
create(String moduleName, Optional<Revision> revision)
Creates new YANG Schema revision source identifier.boolean
equals(Object obj)
int
hashCode()
String
toString()
-
Methods inherited from class org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier
getName, getRevision, intern, toYangFilename, toYangFileName
-
-
-
-
Method Detail
-
create
public static @NonNull RevisionSourceIdentifier create(String moduleName, Optional<Revision> revision)
Creates new YANG Schema revision source identifier.- Parameters:
moduleName
- Name of schemarevision
- Revision of source in format YYYY-mm-dd. If not present, default value will be used.- Returns:
- A RevisionSourceIdentifier
-
create
public static @NonNull RevisionSourceIdentifier create(String moduleName, @Nullable Revision revision)
Creates new YANG Schema revision source identifier.- Parameters:
moduleName
- Name of schemarevision
- Revision of source, may be null- Returns:
- A RevisionSourceIdentifier
-
create
public static @NonNull RevisionSourceIdentifier create(String moduleName)
Creates new YANG Schema revision source identifier for sources without a revision.- Parameters:
moduleName
- Name of schema- Returns:
- A RevisionSourceIdentifier
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceIdentifier
- Overrides:
hashCode
in classObject
-
equals
public boolean equals(Object obj)
- Specified by:
equals
in interfaceIdentifier
- Overrides:
equals
in classObject
-
toString
public String toString()
- Specified by:
toString
in interfaceIdentifier
- Overrides:
toString
in classObject
-
-