Class EnhancedClientUtils


  • public final class EnhancedClientUtils
    extends Object
    • Method Detail

      • cleanAttributeName

        public static String cleanAttributeName​(String key)
        There is a divergence in what constitutes an acceptable attribute name versus a token used in expression names or values. Since the mapper translates one to the other, it is necessary to scrub out all these 'illegal' characters before adding them to expression values or expression names.
        Parameters:
        key - A key that may contain non alpha-numeric characters acceptable to a DynamoDb attribute name.
        Returns:
        A key that has all these characters scrubbed and overwritten with an underscore.
      • keyRef

        public static String keyRef​(String key)
        Creates a key token to be used with an ExpressionNames map.
      • valueRef

        public static String valueRef​(String value)
        Creates a value token to be used with an ExpressionValues map.
      • createKeyFromItem

        public static <T> Key createKeyFromItem​(T item,
                                                TableSchema<T> tableSchema,
                                                String indexName)
      • getItemsFromSupplier

        public static <T> List<T> getItemsFromSupplier​(List<Supplier<T>> itemSupplierList)
      • isNullAttributeValue

        public static boolean isNullAttributeValue​(AttributeValue attributeValue)
        A helper method to test if an AttributeValue is a 'null' constant. This will not test if the AttributeValue object is null itself, and in fact will throw a NullPointerException if you pass in null.
        Parameters:
        attributeValue - An AttributeValue to test for null.
        Returns:
        true if the supplied AttributeValue represents a null value, or false if it does not.