Class BaseChecksummerConfig

java.lang.Object
com.norconex.crawler.core.doc.operations.checksum.BaseChecksummerConfig
Direct Known Subclasses:
GenericMetadataChecksummerConfig, Md5DocumentChecksummerConfig

public class BaseChecksummerConfig extends Object

Abstract implementation of MetadataChecksummer giving the option to keep the generated checksum. The checksum can be stored in a target field name specified. If no target field name is specified, it stores it under the metadata field name CrawlerDocMetaConstants.CHECKSUM_METADATA.

Implementors do not need to store the checksum themselves, this abstract class does it.

Implementors should offer this XML configuration usage:

toField is ignored unless the keep attribute is set to true.

  • Constructor Details

    • BaseChecksummerConfig

      public BaseChecksummerConfig()
  • Method Details

    • isKeep

      public boolean isKeep()
      Whether to keep the metadata checksum value as a new metadata field.
    • getToField

      public String getToField()
      The metadata field to use to store the checksum value. A default field name may be set by checksummer implementations. Only applicable if isKeep() returns true
    • getOnSet

      public PropertySetter getOnSet()
      The property setter to use when a value is set.
    • setKeep

      public BaseChecksummerConfig setKeep(boolean keep)
      Whether to keep the metadata checksum value as a new metadata field.
      Returns:
      this.
    • setToField

      public BaseChecksummerConfig setToField(String toField)
      The metadata field to use to store the checksum value. A default field name may be set by checksummer implementations. Only applicable if isKeep() returns true
      Returns:
      this.
    • setOnSet

      public BaseChecksummerConfig setOnSet(PropertySetter onSet)
      The property setter to use when a value is set.
      Returns:
      this.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object