Package org.pkl.core
Record Class ImportGraph
java.lang.Object
java.lang.Record
org.pkl.core.ImportGraph
- Record Components:
imports- The graph of imports declared within the program.Each key is a module inside the program, and each value is the module URIs declared as imports inside that module. The set of all dependent modules within a program is the set of keys in this map.
resolvedImports- A mapping of a module's in-language URI, and the URI that it resolves to.For example, a local package dependency is represented with scheme
projectpackage:, and (typically) resolves to afile:scheme.
public record ImportGraph(Map<URI,Set<ImportGraph.Import>> imports, Map<URI,URI> resolvedImports)
extends Record
Java representation of
pkl.analyze#ImportGraph.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordJava representation ofpkl.analyze#Import. -
Constructor Summary
ConstructorsConstructorDescriptionImportGraph(Map<URI, Set<ImportGraph.Import>> imports, Map<URI, URI> resolvedImports) Creates an instance of aImportGraphrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.imports()Returns the value of theimportsrecord component.static ImportGraphparseFromJson(String input) Parses the provided JSON into an import graph.Returns the value of theresolvedImportsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ImportGraph
Creates an instance of aImportGraphrecord class.- Parameters:
imports- the value for theimportsrecord componentresolvedImports- the value for theresolvedImportsrecord component
-
-
Method Details
-
parseFromJson
Parses the provided JSON into an import graph.- Throws:
Json.JsonParseException
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
imports
Returns the value of theimportsrecord component.- Returns:
- the value of the
importsrecord component
-
resolvedImports
Returns the value of theresolvedImportsrecord component.- Returns:
- the value of the
resolvedImportsrecord component
-