Class NetworkTraffic.Builder

java.lang.Object
security.whisper.javastix.coo.objects.NetworkTraffic.Builder
Enclosing class:
NetworkTraffic

@NotThreadSafe public static final class NetworkTraffic.Builder extends Object
Builds instances of type NetworkTraffic. 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 NetworkTraffic.Builder from(NetworkTrafficCoo instance)
      Fill a builder with attribute values from the provided security.whisper.javastix.coo.objects.NetworkTrafficCoo instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

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

      @CanIgnoreReturnValue public final NetworkTraffic.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 NetworkTraffic.Builder from(CyberObservableObjectCommonProperties instance)
      Fill a builder with attribute values from the provided security.whisper.javastix.coo.CyberObservableObjectCommonProperties instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • start

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

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the date/time the network traffic was initiated, if known.") public final NetworkTraffic.Builder start(Optional<? extends StixInstant> start)
      Initializes the optional value start to start.
      Parameters:
      start - The value for start
      Returns:
      this builder for use in a chained invocation
    • end

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

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the date/time the network traffic ended, if known.") public final NetworkTraffic.Builder end(Optional<? extends StixInstant> end)
      Initializes the optional value end to end.
      Parameters:
      end - The value for end
      Returns:
      this builder for use in a chained invocation
    • isActive

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

      @CanIgnoreReturnValue @JsonPropertyDescription("Indicates whether the network traffic is still ongoing.") public final NetworkTraffic.Builder isActive(Optional<Boolean> isActive)
      Initializes the optional value isActive to isActive.
      Parameters:
      isActive - The value for isActive
      Returns:
      this builder for use in a chained invocation
    • srcRef

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

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the source of the network traffic, as a reference to one or more Observable Objects.") public final NetworkTraffic.Builder srcRef(Optional<String> srcRef)
      Initializes the optional value srcRef to srcRef.
      Parameters:
      srcRef - The value for srcRef
      Returns:
      this builder for use in a chained invocation
    • dstRef

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

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the destination of the network traffic, as a reference to one or more Observable Objects.") public final NetworkTraffic.Builder dstRef(Optional<String> dstRef)
      Initializes the optional value dstRef to dstRef.
      Parameters:
      dstRef - The value for dstRef
      Returns:
      this builder for use in a chained invocation
    • srcPort

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

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the source port used in the network traffic, as an integer. The port value MUST be in the range of 0 - 65535.") public final NetworkTraffic.Builder srcPort(Optional<Integer> srcPort)
      Initializes the optional value srcPort to srcPort.
      Parameters:
      srcPort - The value for srcPort
      Returns:
      this builder for use in a chained invocation
    • dstPort

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

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the destination port used in the network traffic, as an integer. The port value MUST be in the range of 0 - 65535.") public final NetworkTraffic.Builder dstPort(Optional<Integer> dstPort)
      Initializes the optional value dstPort to dstPort.
      Parameters:
      dstPort - The value for dstPort
      Returns:
      this builder for use in a chained invocation
    • srcByteCount

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

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the number of bytes sent from the source to the destination.") public final NetworkTraffic.Builder srcByteCount(Optional<Long> srcByteCount)
      Initializes the optional value srcByteCount to srcByteCount.
      Parameters:
      srcByteCount - The value for srcByteCount
      Returns:
      this builder for use in a chained invocation
    • dstByteCount

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

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the number of bytes sent from the destination to the source.") public final NetworkTraffic.Builder dstByteCount(Optional<Long> dstByteCount)
      Initializes the optional value dstByteCount to dstByteCount.
      Parameters:
      dstByteCount - The value for dstByteCount
      Returns:
      this builder for use in a chained invocation
    • srcPackets

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

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the number of packets sent from the source to the destination.") public final NetworkTraffic.Builder srcPackets(Optional<Long> srcPackets)
      Initializes the optional value srcPackets to srcPackets.
      Parameters:
      srcPackets - The value for srcPackets
      Returns:
      this builder for use in a chained invocation
    • dstPackets

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

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the number of packets sent destination to the source.") public final NetworkTraffic.Builder dstPackets(Optional<Long> dstPackets)
      Initializes the optional value dstPackets to dstPackets.
      Parameters:
      dstPackets - The value for dstPackets
      Returns:
      this builder for use in a chained invocation
    • putIpFix

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

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

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies any IP Flow Information Export [IPFIX] data for the traffic, as a dictionary.") public final NetworkTraffic.Builder ipFix(Map<String,? extends Object> entries)
      Sets or replaces all mappings from the specified map as entries for the ipFix map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the ipFix map
      Returns:
      this builder for use in a chained invocation
    • putAllIpFix

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

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

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the bytes sent from the source to the destination.") public final NetworkTraffic.Builder srcPayloadRef(Optional<String> srcPayloadRef)
      Initializes the optional value srcPayloadRef to srcPayloadRef.
      Parameters:
      srcPayloadRef - The value for srcPayloadRef
      Returns:
      this builder for use in a chained invocation
    • dstPayloadRef

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

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the bytes sent from the source to the destination.") public final NetworkTraffic.Builder dstPayloadRef(Optional<String> dstPayloadRef)
      Initializes the optional value dstPayloadRef to dstPayloadRef.
      Parameters:
      dstPayloadRef - The value for dstPayloadRef
      Returns:
      this builder for use in a chained invocation
    • encapsulatedByRef

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

      @CanIgnoreReturnValue @JsonPropertyDescription("Links to another network-traffic object which encapsulates this object.") public final NetworkTraffic.Builder encapsulatedByRef(Optional<String> encapsulatedByRef)
      Initializes the optional value encapsulatedByRef to encapsulatedByRef.
      Parameters:
      encapsulatedByRef - The value for encapsulatedByRef
      Returns:
      this builder for use in a chained invocation
    • type

      @CanIgnoreReturnValue public final NetworkTraffic.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
    • addExtension

      @CanIgnoreReturnValue public final NetworkTraffic.Builder addExtension(@Nullable CyberObservableExtension element)
      Adds one element to extensions set.
      Parameters:
      element - A extensions element
      Returns:
      this builder for use in a chained invocation
    • addExtensions

      @CanIgnoreReturnValue public final NetworkTraffic.Builder addExtensions(CyberObservableExtension... elements)
      Adds elements to extensions set.
      Parameters:
      elements - An array of extensions elements
      Returns:
      this builder for use in a chained invocation
    • extensions

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies any extensions of the object, as a dictionary.") public final NetworkTraffic.Builder extensions(Iterable<? extends CyberObservableExtension> elements)
      Sets or replaces all elements for extensions set.
      Parameters:
      elements - An iterable of extensions elements
      Returns:
      this builder for use in a chained invocation
    • addAllExtensions

      @CanIgnoreReturnValue public final NetworkTraffic.Builder addAllExtensions(Iterable<? extends CyberObservableExtension> elements)
      Adds elements to extensions set.
      Parameters:
      elements - An iterable of extensions elements
      Returns:
      this builder for use in a chained invocation
    • observableObjectKey

      @CanIgnoreReturnValue public final NetworkTraffic.Builder observableObjectKey(String observableObjectKey)
      Initializes the value for the observableObjectKey attribute.

      If not set, this attribute will have a default value as returned by the initializer of observableObjectKey.

      Parameters:
      observableObjectKey - The value for observableObjectKey
      Returns:
      this builder for use in a chained invocation
    • defanged

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

      @CanIgnoreReturnValue @JsonPropertyDescription("Indicates whether the data contained in the SCO has been defanged.") public final NetworkTraffic.Builder defanged(Optional<Boolean> defanged)
      Initializes the optional value defanged to defanged.
      Parameters:
      defanged - The value for defanged
      Returns:
      this builder for use in a chained invocation
    • putCustomProperty

      @CanIgnoreReturnValue public final NetworkTraffic.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 NetworkTraffic.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 NetworkTraffic.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 NetworkTraffic.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
    • addObjectMarkingRef

      @CanIgnoreReturnValue public final NetworkTraffic.Builder addObjectMarkingRef(@Nullable MarkingDefinitionDm element)
      Adds one element to objectMarkingRefs set.
      Parameters:
      element - A objectMarkingRefs element
      Returns:
      this builder for use in a chained invocation
    • addObjectMarkingRefs

      @CanIgnoreReturnValue public final NetworkTraffic.Builder addObjectMarkingRefs(MarkingDefinitionDm... elements)
      Adds elements to objectMarkingRefs set.
      Parameters:
      elements - An array of objectMarkingRefs elements
      Returns:
      this builder for use in a chained invocation
    • objectMarkingRefs

      @CanIgnoreReturnValue public final NetworkTraffic.Builder objectMarkingRefs(Iterable<? extends MarkingDefinitionDm> elements)
      Sets or replaces all elements for objectMarkingRefs set.
      Parameters:
      elements - An iterable of objectMarkingRefs elements
      Returns:
      this builder for use in a chained invocation
    • addAllObjectMarkingRefs

      @CanIgnoreReturnValue public final NetworkTraffic.Builder addAllObjectMarkingRefs(Iterable<? extends MarkingDefinitionDm> elements)
      Adds elements to objectMarkingRefs set.
      Parameters:
      elements - An iterable of objectMarkingRefs elements
      Returns:
      this builder for use in a chained invocation
    • addGranularMarking

      @CanIgnoreReturnValue public final NetworkTraffic.Builder addGranularMarking(@Nullable GranularMarkingDm element)
      Adds one element to granularMarkings set.
      Parameters:
      element - A granularMarkings element
      Returns:
      this builder for use in a chained invocation
    • addGranularMarkings

      @CanIgnoreReturnValue public final NetworkTraffic.Builder addGranularMarkings(GranularMarkingDm... elements)
      Adds elements to granularMarkings set.
      Parameters:
      elements - An array of granularMarkings elements
      Returns:
      this builder for use in a chained invocation
    • granularMarkings

      @CanIgnoreReturnValue public final NetworkTraffic.Builder granularMarkings(Iterable<? extends GranularMarkingDm> elements)
      Sets or replaces all elements for granularMarkings set.
      Parameters:
      elements - An iterable of granularMarkings elements
      Returns:
      this builder for use in a chained invocation
    • addAllGranularMarkings

      @CanIgnoreReturnValue public final NetworkTraffic.Builder addAllGranularMarkings(Iterable<? extends GranularMarkingDm> elements)
      Adds elements to granularMarkings set.
      Parameters:
      elements - An iterable of granularMarkings elements
      Returns:
      this builder for use in a chained invocation
    • hydrated

      @CanIgnoreReturnValue public final NetworkTraffic.Builder hydrated(boolean hydrated)
      Initializes the value for the hydrated attribute.
      Parameters:
      hydrated - The value for hydrated
      Returns:
      this builder for use in a chained invocation
    • toJsonString

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

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