Class Conditions

  • All Implemented Interfaces:
    Map<String,​com.amazonaws.services.dynamodbv2.model.Condition>

    @Immutable
    @Loggable(1)
    public final class Conditions
    extends Object
    implements Map<String,​com.amazonaws.services.dynamodbv2.model.Condition>
    DynamoDB query conditions.

    It's a convenient immutable builder of a map of conditions for DynamoDB query/scan operations. Use it like this:

    Map<String, Condition> conditions = new Conditions()
       .with("hash", Conditions.equalTo("some value"))
       .with("range", Conditions.equalTo(12345));
     
    Since:
    0.1
    • Constructor Detail

      • Conditions

        public Conditions()
        Public ctor.
      • Conditions

        public Conditions​(Map<String,​com.amazonaws.services.dynamodbv2.model.Condition> map)
        Public ctor.
        Parameters:
        map - Map of them
    • Method Detail

      • equalTo

        public static com.amazonaws.services.dynamodbv2.model.Condition equalTo​(Long value)
        Equal to static condition builder (factory method).
        Parameters:
        value - The value to equal to
        Returns:
        The condition just created
      • equalTo

        public static com.amazonaws.services.dynamodbv2.model.Condition equalTo​(Integer value)
        Equal to static condition builder (factory method).
        Parameters:
        value - The value to equal to
        Returns:
        The condition just created
      • equalTo

        public static com.amazonaws.services.dynamodbv2.model.Condition equalTo​(Object value)
        Equal to static condition builder (factory method).
        Parameters:
        value - The value to equal to
        Returns:
        The condition just created
      • equalTo

        public static com.amazonaws.services.dynamodbv2.model.Condition equalTo​(com.amazonaws.services.dynamodbv2.model.AttributeValue value)
        Equal to static condition builder (factory method).
        Parameters:
        value - The value to equal to
        Returns:
        The condition just created
      • with

        public Conditions with​(String name,
                               com.amazonaws.services.dynamodbv2.model.Condition value)
        With this condition.
        Parameters:
        name - Attribute name
        value - The condition
        Returns:
        New map of conditions
      • with

        public Conditions with​(String name,
                               Object value)
        With this condition.
        Parameters:
        name - Attribute name
        value - The condition
        Returns:
        New map of conditions
        Since:
        0.18
      • withAttributes

        public Conditions withAttributes​(Map<String,​com.amazonaws.services.dynamodbv2.model.AttributeValue> map)
        With these conditions.
        Parameters:
        map - The conditions
        Returns:
        New map of conditions
      • with

        public Conditions with​(Map<String,​com.amazonaws.services.dynamodbv2.model.Condition> map)
        With these conditions.
        Parameters:
        map - The conditions
        Returns:
        New map of conditions
      • size

        public int size()
        Specified by:
        size in interface Map<String,​com.amazonaws.services.dynamodbv2.model.Condition>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface Map<String,​com.amazonaws.services.dynamodbv2.model.Condition>
      • containsKey

        public boolean containsKey​(Object key)
        Specified by:
        containsKey in interface Map<String,​com.amazonaws.services.dynamodbv2.model.Condition>
      • containsValue

        public boolean containsValue​(Object value)
        Specified by:
        containsValue in interface Map<String,​com.amazonaws.services.dynamodbv2.model.Condition>
      • get

        public com.amazonaws.services.dynamodbv2.model.Condition get​(Object key)
        Specified by:
        get in interface Map<String,​com.amazonaws.services.dynamodbv2.model.Condition>
      • keySet

        public Set<String> keySet()
        Specified by:
        keySet in interface Map<String,​com.amazonaws.services.dynamodbv2.model.Condition>
      • values

        public Collection<com.amazonaws.services.dynamodbv2.model.Condition> values()
        Specified by:
        values in interface Map<String,​com.amazonaws.services.dynamodbv2.model.Condition>
      • entrySet

        public Set<Map.Entry<String,​com.amazonaws.services.dynamodbv2.model.Condition>> entrySet()
        Specified by:
        entrySet in interface Map<String,​com.amazonaws.services.dynamodbv2.model.Condition>
      • put

        public com.amazonaws.services.dynamodbv2.model.Condition put​(String key,
                                                                     com.amazonaws.services.dynamodbv2.model.Condition value)
        Specified by:
        put in interface Map<String,​com.amazonaws.services.dynamodbv2.model.Condition>
      • remove

        public com.amazonaws.services.dynamodbv2.model.Condition remove​(Object key)
        Specified by:
        remove in interface Map<String,​com.amazonaws.services.dynamodbv2.model.Condition>
      • putAll

        public void putAll​(Map<? extends String,​? extends com.amazonaws.services.dynamodbv2.model.Condition> map)
        Specified by:
        putAll in interface Map<String,​com.amazonaws.services.dynamodbv2.model.Condition>
      • clear

        public void clear()
        Specified by:
        clear in interface Map<String,​com.amazonaws.services.dynamodbv2.model.Condition>