Enum ValueMatcher

  • All Implemented Interfaces:
    Serializable, Comparable<ValueMatcher>

    public enum ValueMatcher
    extends Enum<ValueMatcher>
    A policy for determining if a write command should be executed based on the current value in the cache. When retrying conditional write commands in non-transactional caches, it is also used to determine the appropriate return value. E.g. if a putIfAbsent(k, v) already succeeded on a backup owner which became the primary owner, when retrying the command will find v in the cache but should return null. For non-conditional commands it's impossible to know what the previous value was, so the command is allowed to return v.
    Since:
    6.0
    Author:
    Dan Berindei
    • Method Detail

      • values

        public static ValueMatcher[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ValueMatcher c : ValueMatcher.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ValueMatcher valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • matches

        public abstract boolean matches​(Object existingValue,
                                        Object expectedValue,
                                        Object newValue)
      • nonExistentEntryCanMatch

        @Deprecated
        public abstract boolean nonExistentEntryCanMatch()
        Deprecated.
        Since 9.0, no longer used.
      • matcherForRetry

        public abstract ValueMatcher matcherForRetry()
      • valueOf

        public static ValueMatcher valueOf​(int ordinal)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        ordinal - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null