Package cz.cvut.kbss.jopa.utils
Class IdentifierTransformer
java.lang.Object
cz.cvut.kbss.jopa.utils.IdentifierTransformer
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisValidIdentifierType(Class<?> type) Checks whether the specified type is an identifier type supported by JOPA.static StringstringifyIri(Object identifier) Stringifies the specified IRI identifier by enclosing it in < and >.static ObjecttransformToIdentifier(Object value, Class<?> targetType) Transforms the specified value to the target identifier type (if possible).static URIvalueAsUri(Object value)
-
Method Details
-
transformToIdentifier
Transforms the specified value to the target identifier type (if possible).- Parameters:
value- The value to transformtargetType- Target type- Returns:
- The transformed value
- Throws:
IllegalArgumentException- If the target type is not a valid identifier type
-
valueAsUri
-
isValidIdentifierType
Checks whether the specified type is an identifier type supported by JOPA.- Parameters:
type- The type to check- Returns:
trueif type is supported identifier type,falseotherwise
-
stringifyIri
Stringifies the specified IRI identifier by enclosing it in < and >.- Parameters:
identifier- Identifier to stringify- Returns:
- String URI
-