Class NamespaceKeyCriterion<K>

  • Type Parameters:
    K - Key type

    @Beta
    public abstract class NamespaceKeyCriterion<K>
    extends Object
    Namespace key matching criterion.
    Author:
    Robert Varga
    • Constructor Detail

      • NamespaceKeyCriterion

        public NamespaceKeyCriterion()
    • Method Detail

      • latestRevisionModule

        public static NamespaceKeyCriterion<SourceIdentifier> latestRevisionModule​(String moduleName)
        Return a criterion which selects the latest known revision of a particular module.
        Parameters:
        moduleName - Module name
        Returns:
        A criterion object.
      • match

        public abstract boolean match​(@NonNull K key)
        Match a key against this criterion.
        Parameters:
        key - Key to be matched
        Returns:
        True if the key matches this criterion, false otherwise.
      • select

        public abstract K select​(@NonNull K first,
                                 @NonNull K second)
        Select the better match from two candidate keys.
        Parameters:
        first - First key
        second - Second key
        Returns:
        Selected key, must be either first or second key, by identity.
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public final boolean equals​(Object obj)
        Overrides:
        equals in class Object