Package ortus.boxlang.runtime.util
Record Class ResolvedFilePath
java.lang.Object
java.lang.Record
ortus.boxlang.runtime.util.ResolvedFilePath
public record ResolvedFilePath(String mappingName, String mappingPath, String relativePath, Path absolutePath)
extends Record
I represent the a file path that has been resolved to an absolute path.
I track additional data such as what mapping was used to resolve the path.
-
Constructor Summary
ConstructorsConstructorDescriptionResolvedFilePath(String mappingName, String mappingPath, String relativePath, Path absolutePath) Creates an instance of aResolvedFilePathrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theabsolutePathrecord component.final booleanIndicates whether some other object is "equal to" this one.Get the Box package of the resolved path.Get the Box package of the resolved path, but with a prefix prepended in frontgetFQN()Get the package of the resolved path.Get the package of the resolved path, but with a prefix prepended in frontfinal inthashCode()Returns a hash code value for this object.Returns the value of themappingNamerecord component.Returns the value of themappingPathrecord component.newFromRelative(IBoxContext context, String relativePath) Create a new ResolvedFilePath instance from a path relative to the current path.static ResolvedFilePathFactory method to create a new ResolvedFilePath instance using only an absolute path which is a stringstatic ResolvedFilePathFactory method to create a new ResolvedFilePath instance, but using a string for the absolute path.static ResolvedFilePathFactor method to create a new ResolvedFilePath instance.static ResolvedFilePathFactory method to create a new ResolvedFilePath instance using only an absolute path.Returns the value of therelativePathrecord component.booleanWas the path resolved via a mapping?final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ResolvedFilePath
public ResolvedFilePath(String mappingName, String mappingPath, String relativePath, Path absolutePath) Creates an instance of aResolvedFilePathrecord class.- Parameters:
mappingName- the value for themappingNamerecord componentmappingPath- the value for themappingPathrecord componentrelativePath- the value for therelativePathrecord componentabsolutePath- the value for theabsolutePathrecord component
-
-
Method Details
-
of
public static ResolvedFilePath of(String mappingName, String mappingPath, String relativePath, Path absolutePath) Factor method to create a new ResolvedFilePath instance.- Parameters:
mappingName- The mapping name used to resolve the path.mappingPath- The mapping path used to resolve the path.relativePath- The relative path that was resolvedabsolutePath- The absolute path resolved.- Returns:
- A new ResolvedFilePath instance.
-
of
public static ResolvedFilePath of(String mappingName, String mappingPath, String relativePath, String absolutePath) Factory method to create a new ResolvedFilePath instance, but using a string for the absolute path.- Parameters:
mappingName- The mapping name used to resolve the path.mappingPath- The mapping path used to resolve the path.relativePath- The relative path that was resolvedabsolutePath- The absolute path resolved.- Returns:
- A new ResolvedFilePath instance.
-
of
Factory method to create a new ResolvedFilePath instance using only an absolute path.- Parameters:
absolutePath- The absolute path resolved.- Returns:
- A new ResolvedFilePath instance.
-
of
Factory method to create a new ResolvedFilePath instance using only an absolute path which is a string- Parameters:
absolutePath- The absolute path resolved.- Returns:
- A new ResolvedFilePath instance.
-
resolvedViaMapping
public boolean resolvedViaMapping()Was the path resolved via a mapping?- Returns:
- true if the path was resolved via a mapping.
-
getFQN
Get the package of the resolved path, but with a prefix prepended in front- Parameters:
prefix- The prefix to prepend to the package.- Returns:
- The package of the resolved path with the prefix prepended.
-
getFQN
Get the package of the resolved path.- Returns:
- The package of the resolved path.
-
getBoxFQN
Get the Box package of the resolved path.- Returns:
- The package of the resolved path.
-
getBoxFQN
Get the Box package of the resolved path, but with a prefix prepended in front- Parameters:
prefix- The prefix to prepend to the package.- Returns:
- The package of the resolved path with the prefix prepended.
-
newFromRelative
Create a new ResolvedFilePath instance from a path relative to the current path.- Parameters:
relativePath- The relative path to create a new ResolvedFilePath instance from.- Returns:
- A new ResolvedFilePath instance.
-
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). -
mappingName
Returns the value of themappingNamerecord component.- Returns:
- the value of the
mappingNamerecord component
-
mappingPath
Returns the value of themappingPathrecord component.- Returns:
- the value of the
mappingPathrecord component
-
relativePath
Returns the value of therelativePathrecord component.- Returns:
- the value of the
relativePathrecord component
-
absolutePath
Returns the value of theabsolutePathrecord component.- Returns:
- the value of the
absolutePathrecord component
-