public final class ResourceType
extends java.lang.Object
ResourceType encapsulates details about a Sling resource type and provides methods for parsing resource type strings.
The following patterns are supported for parsing:
a/b/c - path-baseda/b/c/1.0.0 - path-based, versioneda.b.c - Java package namea.b.c/1.0.0 - Java package name, versioneda - flat (sub-set of path-based)| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
@NotNull java.lang.String |
getResourceLabel()
Returns a resource type's label.
|
@NotNull java.lang.String |
getType()
Returns the resource type string, without any version information.
|
@Nullable org.osgi.framework.Version |
getVersion()
Returns the version, if available.
|
int |
hashCode() |
static @NotNull ResourceType |
parseResourceType(@NotNull java.lang.String resourceTypeString)
Given a
resourceTypeString, this method will extract a ResourceType object. |
java.lang.String |
toString() |
@NotNull public @NotNull java.lang.String getResourceLabel()
@NotNull public @NotNull java.lang.String getType()
@Nullable public @Nullable org.osgi.framework.Version getVersion()
null otherwisepublic java.lang.String toString()
toString in class java.lang.Object@NotNull public static @NotNull ResourceType parseResourceType(@NotNull @NotNull java.lang.String resourceTypeString)
resourceTypeString, this method will extract a ResourceType object.
The accepted patterns are:
a/b/c - path-baseda/b/c/1.0.0 - path-based, versioneda.b.c - Java package namea.b.c/1.0.0 - Java package name, versioneda - flat (sub-set of path-based)resourceTypeString - the resource type string to parseResourceType objectjava.lang.IllegalArgumentException - if the resourceTypeString cannot be parsedpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.ObjectCopyright © 2022 The Apache Software Foundation. All rights reserved.