Class ResourceName
java.lang.Object
migratedb.v1.core.api.internal.resource.ResourceName
Represents a resource name, parsed into its components.
Versioned and Undo migrations are named in the form prefixVERSIONseparatorDESCRIPTIONsuffix; Repeatable migrations and callbacks are named in the form prefixSeparatorDESCRIPTIONsuffix
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe description of the resourceThe filename of the resource as it appears on diskThe full name of the resourceThe prefix of the resource (eg.The file type suffix of the resource (eg. ".sql" for SQL migration scripts)If the resource name was not successfully parsed, an explanation of the problem.@Nullable VersionThe version of the resource (eg. "1.2.3" for versioned migrations), or null for non-versioned resourcesstatic ResourceNameConstruct a result representing an invalid resource namebooleanisValid()Whether the resource name was successfully parsed.
-
Constructor Details
-
ResourceName
-
-
Method Details
-
invalid
Construct a result representing an invalid resource name- Parameters:
message- A message explaining the reason the resource name is invalid- Returns:
- The fully populated parsing result.
-
getPrefix
The prefix of the resource (eg. "V" for versioned migrations) -
getVersion
The version of the resource (eg. "1.2.3" for versioned migrations), or null for non-versioned resources -
getDescription
The description of the resource -
getSuffix
The file type suffix of the resource (eg. ".sql" for SQL migration scripts) -
getFilenameWithoutSuffix
The full name of the resource -
getFilename
The filename of the resource as it appears on disk -
isValid
public boolean isValid()Whether the resource name was successfully parsed. -
getValidityMessage
If the resource name was not successfully parsed, an explanation of the problem.
-