Class StructureUtils

java.lang.Object
org.gridgain.structure.StructureUtils

public final class StructureUtils extends Object
Structure utils.
  • Method Details

    • cast

      public static <T> T cast(Object obj)
      Returns a given object as a typed one.
    • cast

      public static <T, R> Marshaller<T,R> cast(Marshaller<?,?> marshaller)
      Returns a given marshaller as a typed one.
    • cast

      public static <K, V> Map<K,V> cast(Map<?,?> map)
      Returns a given map as a typed one.
    • nativeOrByteArray

      public static <T> Class<T> nativeOrByteArray(Class<?> clazz)
      Returns same class if natively supported, else byte[].
    • columnClassByName

      @Nullable public static @Nullable Class<?> columnClassByName(String className)
      Returns the class with the given binary name if a column can have it, or null if it cannot. The answer does not depend on the node classpath.

      Use this for a name from an untrusted source instead of Class.forName(java.lang.String), which would load and initialize any class the caller can name.

    • marshaller

      public static <T> Marshaller<T,?> marshaller(Class<T> clazz)
      Returns noop marshaller if natively supported, else ByteArrayMarshaller.
    • columnType

      public static ColumnType columnType(Class<?> clazz)
      Return corresponding column type if natively supported, else byte_array.