Class IdentifierTransformer

java.lang.Object
cz.cvut.kbss.jopa.utils.IdentifierTransformer

public class IdentifierTransformer extends Object
  • Method Details

    • transformToIdentifier

      public static Object transformToIdentifier(Object value, Class<?> targetType)
      Transforms the specified value to the target identifier type (if possible).
      Parameters:
      value - The value to transform
      targetType - Target type
      Returns:
      The transformed value
      Throws:
      IllegalArgumentException - If the target type is not a valid identifier type
    • valueAsUri

      public static URI valueAsUri(Object value)
    • isValidIdentifierType

      public static boolean isValidIdentifierType(Class<?> type)
      Checks whether the specified type is an identifier type supported by JOPA.
      Parameters:
      type - The type to check
      Returns:
      true if type is supported identifier type, false otherwise
    • stringifyIri

      public static String stringifyIri(Object identifier)
      Stringifies the specified IRI identifier by enclosing it in < and >.
      Parameters:
      identifier - Identifier to stringify
      Returns:
      String URI