Class KeyTypeUtils


  • @BetaApi
    public final class KeyTypeUtils
    extends java.lang.Object
    Utilities for converting key values.
    • Constructor Summary

      Constructors 
      Constructor Description
      KeyTypeUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Object tryConvert​(java.lang.Object value, IdType destinationType)
      Attempt to convert an object to a key value of a specific type.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • KeyTypeUtils

        public KeyTypeUtils()
    • Method Detail

      • tryConvert

        public static java.lang.Object tryConvert​(java.lang.Object value,
                                                  IdType destinationType)
        Attempt to convert an object to a key value of a specific type.
        Parameters:
        value - The object to convert.
        destinationType - The expected key type.
        Returns:
        The converted object.
        Throws:
        java.lang.IllegalArgumentException - if conversion is not possible.