Class CensorElement

java.lang.Object
com.easypost.easyvcr.CensorElement
Direct Known Subclasses:
RegexCensorElement

public class CensorElement extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
    Whether the value must match exactly to trigger a censor.
    protected String
    The value of the element to censor.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CensorElement​(String name, boolean caseSensitive)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    matches​(String key)
    Return whether the element matches the name, accounting for case sensitivity.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • value

      protected final String value
      The value of the element to censor.
    • caseSensitive

      protected final boolean caseSensitive
      Whether the value must match exactly to trigger a censor.
  • Constructor Details

    • CensorElement

      public CensorElement(String name, boolean caseSensitive)
      Constructor.
      Parameters:
      name - The name of the element to censor.
      caseSensitive - Whether the name must match exactly to trigger a censor.
  • Method Details

    • matches

      public boolean matches(String key)
      Return whether the element matches the name, accounting for case sensitivity.
      Parameters:
      key - The name to check.
      Returns:
      True if the element matches the name.