Class Consent

All Implemented Interfaces:
Component, DestructableComponent, IdentifiableComponent, IdentifiedComponent, InitializableComponent

public class Consent extends AbstractIdentifiableInitializableComponent
Represents consent. A consent object consists of an identifier, a value (usually a hash) representing the thing being consented to, and a boolean which indicates whether consent is approved or denied.
  • Field Details

    • WILDCARD

      @Nonnull @NotEmpty public static final String WILDCARD
      Wildcard used to represent consent to any ID or value.
      See Also:
    • value

      @Nullable private String value
      Consent value.
    • approved

      @Nullable private boolean approved
      Whether consent is approved.
  • Constructor Details

    • Consent

      public Consent()
  • Method Details

    • getValue

      @Nullable public String getValue()
      Get the consent value.
      Returns:
      the consent value
    • isApproved

      @Nullable public boolean isApproved()
      Whether consent is approved or denied.
      Returns:
      true if consent is approved
    • setValue

      public void setValue(@Nonnull @NotEmpty String val)
      Set the consent value.
      Parameters:
      val - the consent value
    • setApproved

      public void setApproved(boolean flag)
      Set whether consent is approved.
      Parameters:
      flag - true if consent is approved
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object