Class EntityTagMatcher

    • Method Detail

      • fromString

        public static EntityTagMatcher fromString​(String entityTagMatcher)
        Builds an EntityTagMatcher from a String value.
        Parameters:
        entityTagMatcher - the string representation of the entity-tag-matcher.
        Returns:
        the EntityTagMatcher built from the given string value.
        Throws:
        NullPointerException - if EntityTagMatcher is null.
        DittoHeaderInvalidException - if the given entityTagMatcher is not valid according to isValid(CharSequence).
      • asterisk

        public static EntityTagMatcher asterisk()
        Returns:
        the * entity-tag value.
      • isValid

        public static boolean isValid​(@Nullable
                                      CharSequence entityTagMatcher)
        Checks if the given char sequence in terms of being a valid EntityTagMatcher
        Parameters:
        entityTagMatcher - the char sequence to validate.
        Returns:
        true if the given entity tag matcher is valid, false else.
      • weakMatch

        public boolean weakMatch​(EntityTag entityTagToMatch)
        Matches this EntityTagMatcher to the given entityTagToMatch.
        Parameters:
        entityTagToMatch - The EntityTag to match against.
        Returns:
        Always true if this instance is isAsterisk. Else returns result of EntityTag.weakCompareTo(EntityTag) weak comparison between two entity-tags}.
      • isAsterisk

        public boolean isAsterisk()
        Indicates whether this entity-tag equals "*".
        Returns:
        true if entity-tag is an asterisk, false else.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object