Interface ICSPDirective

All Superinterfaces:
com.helger.base.name.IHasName
All Known Implementing Classes:
CSPDirective

public interface ICSPDirective extends com.helger.base.name.IHasName
A single CSP directive. It's a name-value-pair.
Author:
Philip Helger
  • Method Details

    • getName

      @Nonempty @NonNull @Nonempty String getName()
      Specified by:
      getName in interface com.helger.base.name.IHasName
      Returns:
      The name of this directive.
    • getValue

      @Nullable String getValue()
      Returns:
      The value of this directive. May be null or empty.
    • hasValue

      default boolean hasValue()
      Returns:
      true if this directive has a non-empty value, false otherwise.
    • getAsString

      @Nonempty default @NonNull @Nonempty String getAsString()
      Returns:
      The directive as a string in the format "name value". Never null.
    • getAsStringIfHasValue

      default @Nullable String getAsStringIfHasValue()
      Returns:
      The directive as a string in the format "name value" if a value is present, or null if no value is set.