Class HostEndsWith

java.lang.Object
it.unimi.dsi.law.warc.filters.AbstractFilter<URI>
it.unimi.dsi.law.warc.filters.HostEndsWith
All Implemented Interfaces:
com.google.common.base.Predicate<URI>, Filter<URI>, Predicate<URI>

public class HostEndsWith
extends AbstractFilter<URI>
Accepts only URIs whose host ends with (case-insensitively) a certain suffix.

Note that apply(URI) will throw an IllegalArgumentException if the argument has a null host.

  • Constructor Details

    • HostEndsWith

      public HostEndsWith​(String suffix)
      Creates a filter that only accepts URLs with a given suffix.
      Parameters:
      suffix - the accepted suffix.
  • Method Details

    • apply

      public boolean apply​(URI uri)
    • valueOf

      public static HostEndsWith valueOf​(String spec)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals​(Object x)
      Specified by:
      equals in interface com.google.common.base.Predicate<URI>
      Overrides:
      equals in class Object