Package datomic

Class Util

java.lang.Object
datomic.Util

public final class Util extends Object
Utilities for creating and using data structures.
  • Method Details

    • name

      public static String name(Object k)
      Returns the name part of a keyword or symbol.
      Parameters:
      k - - a keyword or symbol
      Returns:
      the name
    • namespace

      public static String namespace(Object k)
      Returns the namespace part of a keyword or symbol.
      Parameters:
      k - - a Keyword
      Returns:
      the namespace
    • list

      public static List list(Object... items)
      Creates an immutable List.
      Parameters:
      items - - Objects to be included in the List
      Returns:
      an unmodifiable List
    • map

      public static Map map(Object... keyvals)
      Creates an immutable Map.
      Parameters:
      keyvals - - pairs to include in the Map, written as key1, value1, key2, value2, and so on
      Returns:
      an unmodifiable Map
    • read

      public static Object read(String source)
      Reads one item from source, returning it.
      Parameters:
      source - an edn string
      Returns:
      the object read
    • readAll

      public static List readAll(Reader reader)
      Reads all the data in reader, returning a List. Closes reader.
      Parameters:
      reader - - the edn data to parse.
      Returns:
      a List for the parsed data.
    • streamOn

      public static Stream streamOn(Iterable it)
      Create a stream on an immutable Iterable.
      Parameters:
      it - an Iterator
      Returns:
      a sequential Stream