Class HttpRequestExtension.Builder

java.lang.Object
security.whisper.javastix.coo.extension.types.HttpRequestExtension.Builder
Enclosing class:
HttpRequestExtension

@NotThreadSafe public static final class HttpRequestExtension.Builder extends Object
Builds instances of type HttpRequestExtension. Initialize attributes and then invoke the build() method to create an immutable instance.

Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

  • Method Details

    • from

      @CanIgnoreReturnValue public final HttpRequestExtension.Builder from(HttpRequestExtensionExt instance)
      Fill a builder with attribute values from the provided security.whisper.javastix.coo.extension.types.HttpRequestExtensionExt instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      @CanIgnoreReturnValue public final HttpRequestExtension.Builder from(StixCustomProperties instance)
      Fill a builder with attribute values from the provided security.whisper.javastix.common.StixCustomProperties instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      @CanIgnoreReturnValue public final HttpRequestExtension.Builder from(CyberObservableExtensionCommonProperties instance)
      Fill a builder with attribute values from the provided security.whisper.javastix.coo.extension.CyberObservableExtensionCommonProperties instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • requestMethod

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the HTTP method portion of the HTTP request line, as a lowercase string.") public final HttpRequestExtension.Builder requestMethod(String requestMethod)
      Initializes the value for the requestMethod attribute.
      Parameters:
      requestMethod - The value for requestMethod (can be null)
      Returns:
      this builder for use in a chained invocation
    • requestValue

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the value (typically a resource path) portion of the HTTP request line.") public final HttpRequestExtension.Builder requestValue(String requestValue)
      Initializes the value for the requestValue attribute.
      Parameters:
      requestValue - The value for requestValue (can be null)
      Returns:
      this builder for use in a chained invocation
    • requestVersion

      @CanIgnoreReturnValue public final HttpRequestExtension.Builder requestVersion(String requestVersion)
      Initializes the optional value requestVersion to requestVersion.
      Parameters:
      requestVersion - The value for requestVersion
      Returns:
      this builder for chained invocation
    • requestVersion

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the HTTP version portion of the HTTP request line, as a lowercase string.") public final HttpRequestExtension.Builder requestVersion(Optional<String> requestVersion)
      Initializes the optional value requestVersion to requestVersion.
      Parameters:
      requestVersion - The value for requestVersion
      Returns:
      this builder for use in a chained invocation
    • putRequestHeader

      @CanIgnoreReturnValue public final HttpRequestExtension.Builder putRequestHeader(String key, String value)
      Put one entry to the requestHeader map.
      Parameters:
      key - The key in the requestHeader map
      value - The associated value in the requestHeader map
      Returns:
      this builder for use in a chained invocation
    • putRequestHeader

      @CanIgnoreReturnValue public final HttpRequestExtension.Builder putRequestHeader(Map.Entry<String,? extends String> entry)
      Put one entry to the requestHeader map. Nulls are not permitted
      Parameters:
      entry - The key and value entry
      Returns:
      this builder for use in a chained invocation
    • requestHeader

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies all of the HTTP header fields that may be found in the HTTP client request, as a dictionary.") public final HttpRequestExtension.Builder requestHeader(Map<String,? extends String> entries)
      Sets or replaces all mappings from the specified map as entries for the requestHeader map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the requestHeader map
      Returns:
      this builder for use in a chained invocation
    • putAllRequestHeader

      @CanIgnoreReturnValue public final HttpRequestExtension.Builder putAllRequestHeader(Map<String,? extends String> entries)
      Put all mappings from the specified map as entries to requestHeader map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the requestHeader map
      Returns:
      this builder for use in a chained invocation
    • messageBodyLength

      @CanIgnoreReturnValue public final HttpRequestExtension.Builder messageBodyLength(long messageBodyLength)
      Initializes the optional value messageBodyLength to messageBodyLength.
      Parameters:
      messageBodyLength - The value for messageBodyLength
      Returns:
      this builder for chained invocation
    • messageBodyLength

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the length of the HTTP message body, if included, in bytes.") public final HttpRequestExtension.Builder messageBodyLength(Optional<Long> messageBodyLength)
      Initializes the optional value messageBodyLength to messageBodyLength.
      Parameters:
      messageBodyLength - The value for messageBodyLength
      Returns:
      this builder for use in a chained invocation
    • messageBodyDataRef

      @CanIgnoreReturnValue public final HttpRequestExtension.Builder messageBodyDataRef(String messageBodyDataRef)
      Initializes the optional value messageBodyDataRef to messageBodyDataRef.
      Parameters:
      messageBodyDataRef - The value for messageBodyDataRef
      Returns:
      this builder for chained invocation
    • messageBodyDataRef

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the data contained in the HTTP message body, if included.") public final HttpRequestExtension.Builder messageBodyDataRef(Optional<String> messageBodyDataRef)
      Initializes the optional value messageBodyDataRef to messageBodyDataRef.
      Parameters:
      messageBodyDataRef - The value for messageBodyDataRef
      Returns:
      this builder for use in a chained invocation
    • type

      @CanIgnoreReturnValue public final HttpRequestExtension.Builder type(String type)
      Initializes the value for the type attribute.
      Parameters:
      type - The value for type (can be null)
      Returns:
      this builder for use in a chained invocation
    • putCustomProperty

      @CanIgnoreReturnValue public final HttpRequestExtension.Builder putCustomProperty(String key, Object value)
      Put one entry to the customProperties map.
      Parameters:
      key - The key in the customProperties map
      value - The associated value in the customProperties map
      Returns:
      this builder for use in a chained invocation
    • putCustomProperty

      @CanIgnoreReturnValue public final HttpRequestExtension.Builder putCustomProperty(Map.Entry<String,? extends Object> entry)
      Put one entry to the customProperties map. Nulls are not permitted
      Parameters:
      entry - The key and value entry
      Returns:
      this builder for use in a chained invocation
    • customProperties

      @CanIgnoreReturnValue public final HttpRequestExtension.Builder customProperties(Map<String,? extends Object> entries)
      Sets or replaces all mappings from the specified map as entries for the customProperties map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the customProperties map
      Returns:
      this builder for use in a chained invocation
    • putAllCustomProperties

      @CanIgnoreReturnValue public final HttpRequestExtension.Builder putAllCustomProperties(Map<String,? extends Object> entries)
      Put all mappings from the specified map as entries to customProperties map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the customProperties map
      Returns:
      this builder for use in a chained invocation
    • build

      public HttpRequestExtension build()
      Builds a new HttpRequestExtension.
      Returns:
      An immutable instance of HttpRequestExtension
      Throws:
      IllegalStateException - if any required attributes are missing