Class ConfluentResourceName
java.lang.Object
io.confluent.crn.ConfluentResourceName
- All Implemented Interfaces:
Comparable<ConfluentResourceName>
A ConfluentResourceName is a compound identifier that identifies a resource or pattern.
The textual representation of a CRN is a URI with a scheme of "crn". The Authority section of the
URI SHOULD BE a domain name controlled by the organization that is responsible for the names. The
Path section of the URI is a sequence of type=identifier elements, separated by /. The
identifiers are URL Encoded, so that any unusual characters are escaped.
If the CRN represents a pattern, the Path section will contain a literal '*' (not URL Encoded)
at the end of an identifier for a PREFIX pattern, or in place of an identifier for an ANY
pattern. A CRN pattern with an empty Authority section matches ANY Authority. (The converse is
not true: A CRN pattern with a non-empty Authority will not match a CRN with an empty Authority).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic class -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionReturn a CRN of the same form as this one, with all resource names as wildcardsReturn the authority of this CRNintelements()Return an ordered list of the elements of this CRNbooleanstatic ConfluentResourceNamefromString(String crn) Parse the given string to a ConfluentResourceName, throw if it can't be parsedinthashCode()Returns the last element in the list of elements.booleanmatches(ConfluentResourceName that) Treating this CRN as a pattern, does the other CRN match it?Returns the Resource Type of the resource(s) referred to by the CRN.toString()
-
Field Details
-
DEFAULT_AUTHORITY
- See Also:
-
-
Method Details
-
authority
Return the authority of this CRN -
elements
Return an ordered list of the elements of this CRN -
lastResourceElement
Returns the last element in the list of elements. Since the list is ordered general-to-specific, this is the resource represented by the name without its scope. Because the Builder enforces that there's at least one element, this should always return something. -
resourceType
Returns the Resource Type of the resource(s) referred to by the CRN. This is the Resource Type of the last element.- Returns:
-
matches
Treating this CRN as a pattern, does the other CRN match it? -
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<ConfluentResourceName>
-
equals
-
hashCode
-
allWildcards
Return a CRN of the same form as this one, with all resource names as wildcards -
fromString
Parse the given string to a ConfluentResourceName, throw if it can't be parsed- Throws:
CrnSyntaxException
-
newBuilder
-