Class NetworkTraffic.Builder
java.lang.Object
security.whisper.javastix.coo.objects.NetworkTraffic.Builder
- Enclosing class:
NetworkTraffic
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 Summary
Modifier and TypeMethodDescriptionfinal NetworkTraffic.BuilderaddAllExtensions(Iterable<? extends CyberObservableExtension> elements) Adds elements toextensionsset.final NetworkTraffic.BuilderaddAllGranularMarkings(Iterable<? extends GranularMarkingDm> elements) Adds elements togranularMarkingsset.final NetworkTraffic.BuilderaddAllObjectMarkingRefs(Iterable<? extends MarkingDefinitionDm> elements) Adds elements toobjectMarkingRefsset.final NetworkTraffic.BuilderaddExtension(CyberObservableExtension element) Adds one element toextensionsset.final NetworkTraffic.BuilderaddExtensions(CyberObservableExtension... elements) Adds elements toextensionsset.final NetworkTraffic.BuilderaddGranularMarking(GranularMarkingDm element) Adds one element togranularMarkingsset.final NetworkTraffic.BuilderaddGranularMarkings(GranularMarkingDm... elements) Adds elements togranularMarkingsset.final NetworkTraffic.BuilderaddObjectMarkingRef(MarkingDefinitionDm element) Adds one element toobjectMarkingRefsset.final NetworkTraffic.BuilderaddObjectMarkingRefs(MarkingDefinitionDm... elements) Adds elements toobjectMarkingRefsset.build()Builds a newNetworkTraffic.final NetworkTraffic.BuildercustomProperties(Map<String, ? extends Object> entries) Sets or replaces all mappings from the specified map as entries for thecustomPropertiesmap.final NetworkTraffic.Builderdefanged(boolean defanged) Initializes the optional valuedefangedto defanged.final NetworkTraffic.BuilderInitializes the optional valuedefangedto defanged.final NetworkTraffic.BuilderdstByteCount(long dstByteCount) Initializes the optional valuedstByteCountto dstByteCount.final NetworkTraffic.BuilderdstByteCount(Optional<Long> dstByteCount) Initializes the optional valuedstByteCountto dstByteCount.final NetworkTraffic.BuilderdstPackets(long dstPackets) Initializes the optional valuedstPacketsto dstPackets.final NetworkTraffic.BuilderdstPackets(Optional<Long> dstPackets) Initializes the optional valuedstPacketsto dstPackets.final NetworkTraffic.BuilderdstPayloadRef(String dstPayloadRef) Initializes the optional valuedstPayloadRefto dstPayloadRef.final NetworkTraffic.BuilderdstPayloadRef(Optional<String> dstPayloadRef) Initializes the optional valuedstPayloadRefto dstPayloadRef.final NetworkTraffic.BuilderdstPort(int dstPort) Initializes the optional valuedstPortto dstPort.final NetworkTraffic.BuilderInitializes the optional valuedstPortto dstPort.final NetworkTraffic.BuilderInitializes the optional valuedstRefto dstRef.final NetworkTraffic.BuilderInitializes the optional valuedstRefto dstRef.final NetworkTraffic.BuilderencapsulatedByRef(String encapsulatedByRef) Initializes the optional valueencapsulatedByRefto encapsulatedByRef.final NetworkTraffic.BuilderencapsulatedByRef(Optional<String> encapsulatedByRef) Initializes the optional valueencapsulatedByRefto encapsulatedByRef.final NetworkTraffic.Builderend(Optional<? extends StixInstant> end) Initializes the optional valueendto end.final NetworkTraffic.Builderend(StixInstant end) Initializes the optional valueendto end.final NetworkTraffic.Builderextensions(Iterable<? extends CyberObservableExtension> elements) Sets or replaces all elements forextensionsset.final NetworkTraffic.Builderfrom(BundleableObject instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.bundle.BundleableObjectinstance.final NetworkTraffic.Builderfrom(StixCustomProperties instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.common.StixCustomPropertiesinstance.final NetworkTraffic.Builderfrom(CyberObservableObjectCommonProperties instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.coo.CyberObservableObjectCommonPropertiesinstance.final NetworkTraffic.Builderfrom(NetworkTrafficCoo instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.coo.objects.NetworkTrafficCooinstance.final NetworkTraffic.BuildergranularMarkings(Iterable<? extends GranularMarkingDm> elements) Sets or replaces all elements forgranularMarkingsset.final NetworkTraffic.Builderhydrated(boolean hydrated) Initializes the value for thehydratedattribute.final NetworkTraffic.BuilderSets or replaces all mappings from the specified map as entries for theipFixmap.final NetworkTraffic.BuilderisActive(boolean isActive) Initializes the optional valueisActiveto isActive.final NetworkTraffic.BuilderInitializes the optional valueisActiveto isActive.final NetworkTraffic.BuilderobjectMarkingRefs(Iterable<? extends MarkingDefinitionDm> elements) Sets or replaces all elements forobjectMarkingRefsset.final NetworkTraffic.BuilderobservableObjectKey(String observableObjectKey) Initializes the value for theobservableObjectKeyattribute.final NetworkTraffic.BuilderputAllCustomProperties(Map<String, ? extends Object> entries) Put all mappings from the specified map as entries tocustomPropertiesmap.final NetworkTraffic.BuilderputAllIpFix(Map<String, ? extends Object> entries) Put all mappings from the specified map as entries toipFixmap.final NetworkTraffic.BuilderputCustomProperty(String key, Object value) Put one entry to thecustomPropertiesmap.final NetworkTraffic.BuilderputCustomProperty(Map.Entry<String, ? extends Object> entry) Put one entry to thecustomPropertiesmap.final NetworkTraffic.BuilderPut one entry to theipFixmap.final NetworkTraffic.BuilderPut one entry to theipFixmap.final NetworkTraffic.BuildersrcByteCount(long srcByteCount) Initializes the optional valuesrcByteCountto srcByteCount.final NetworkTraffic.BuildersrcByteCount(Optional<Long> srcByteCount) Initializes the optional valuesrcByteCountto srcByteCount.final NetworkTraffic.BuildersrcPackets(long srcPackets) Initializes the optional valuesrcPacketsto srcPackets.final NetworkTraffic.BuildersrcPackets(Optional<Long> srcPackets) Initializes the optional valuesrcPacketsto srcPackets.final NetworkTraffic.BuildersrcPayloadRef(String srcPayloadRef) Initializes the optional valuesrcPayloadRefto srcPayloadRef.final NetworkTraffic.BuildersrcPayloadRef(Optional<String> srcPayloadRef) Initializes the optional valuesrcPayloadRefto srcPayloadRef.final NetworkTraffic.BuildersrcPort(int srcPort) Initializes the optional valuesrcPortto srcPort.final NetworkTraffic.BuilderInitializes the optional valuesrcPortto srcPort.final NetworkTraffic.BuilderInitializes the optional valuesrcRefto srcRef.final NetworkTraffic.BuilderInitializes the optional valuesrcRefto srcRef.final NetworkTraffic.Builderstart(Optional<? extends StixInstant> start) Initializes the optional valuestartto start.final NetworkTraffic.Builderstart(StixInstant start) Initializes the optional valuestartto start.final NetworkTraffic.BuildertoJsonString(String toJsonString) Initializes the value for thetoJsonStringattribute.final NetworkTraffic.BuilderInitializes the value for thetypeattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedsecurity.whisper.javastix.coo.objects.NetworkTrafficCooinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
Fill a builder with attribute values from the providedsecurity.whisper.javastix.bundle.BundleableObjectinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
Fill a builder with attribute values from the providedsecurity.whisper.javastix.common.StixCustomPropertiesinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final NetworkTraffic.Builder from(CyberObservableObjectCommonProperties instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.coo.CyberObservableObjectCommonPropertiesinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
start
Initializes the optional valuestartto start.- Parameters:
start- The value for start- Returns:
thisbuilder 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 valuestartto start.- Parameters:
start- The value for start- Returns:
thisbuilder for use in a chained invocation
-
end
Initializes the optional valueendto end.- Parameters:
end- The value for end- Returns:
thisbuilder 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 valueendto end.- Parameters:
end- The value for end- Returns:
thisbuilder for use in a chained invocation
-
isActive
Initializes the optional valueisActiveto isActive.- Parameters:
isActive- The value for isActive- Returns:
thisbuilder 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 valueisActiveto isActive.- Parameters:
isActive- The value for isActive- Returns:
thisbuilder for use in a chained invocation
-
srcRef
Initializes the optional valuesrcRefto srcRef.- Parameters:
srcRef- The value for srcRef- Returns:
thisbuilder 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 valuesrcRefto srcRef.- Parameters:
srcRef- The value for srcRef- Returns:
thisbuilder for use in a chained invocation
-
dstRef
Initializes the optional valuedstRefto dstRef.- Parameters:
dstRef- The value for dstRef- Returns:
thisbuilder 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 valuedstRefto dstRef.- Parameters:
dstRef- The value for dstRef- Returns:
thisbuilder for use in a chained invocation
-
srcPort
Initializes the optional valuesrcPortto srcPort.- Parameters:
srcPort- The value for srcPort- Returns:
thisbuilder 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 valuesrcPortto srcPort.- Parameters:
srcPort- The value for srcPort- Returns:
thisbuilder for use in a chained invocation
-
dstPort
Initializes the optional valuedstPortto dstPort.- Parameters:
dstPort- The value for dstPort- Returns:
thisbuilder 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 valuedstPortto dstPort.- Parameters:
dstPort- The value for dstPort- Returns:
thisbuilder for use in a chained invocation
-
srcByteCount
Initializes the optional valuesrcByteCountto srcByteCount.- Parameters:
srcByteCount- The value for srcByteCount- Returns:
thisbuilder 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 valuesrcByteCountto srcByteCount.- Parameters:
srcByteCount- The value for srcByteCount- Returns:
thisbuilder for use in a chained invocation
-
dstByteCount
Initializes the optional valuedstByteCountto dstByteCount.- Parameters:
dstByteCount- The value for dstByteCount- Returns:
thisbuilder 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 valuedstByteCountto dstByteCount.- Parameters:
dstByteCount- The value for dstByteCount- Returns:
thisbuilder for use in a chained invocation
-
srcPackets
Initializes the optional valuesrcPacketsto srcPackets.- Parameters:
srcPackets- The value for srcPackets- Returns:
thisbuilder 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 valuesrcPacketsto srcPackets.- Parameters:
srcPackets- The value for srcPackets- Returns:
thisbuilder for use in a chained invocation
-
dstPackets
Initializes the optional valuedstPacketsto dstPackets.- Parameters:
dstPackets- The value for dstPackets- Returns:
thisbuilder 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 valuedstPacketsto dstPackets.- Parameters:
dstPackets- The value for dstPackets- Returns:
thisbuilder for use in a chained invocation
-
putIpFix
Put one entry to theipFixmap.- Parameters:
key- The key in the ipFix mapvalue- The associated value in the ipFix map- Returns:
thisbuilder for use in a chained invocation
-
putIpFix
@CanIgnoreReturnValue public final NetworkTraffic.Builder putIpFix(Map.Entry<String, ? extends Object> entry) Put one entry to theipFixmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder 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 theipFixmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the ipFix map- Returns:
thisbuilder 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 toipFixmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the ipFix map- Returns:
thisbuilder for use in a chained invocation
-
srcPayloadRef
Initializes the optional valuesrcPayloadRefto srcPayloadRef.- Parameters:
srcPayloadRef- The value for srcPayloadRef- Returns:
thisbuilder 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 valuesrcPayloadRefto srcPayloadRef.- Parameters:
srcPayloadRef- The value for srcPayloadRef- Returns:
thisbuilder for use in a chained invocation
-
dstPayloadRef
Initializes the optional valuedstPayloadRefto dstPayloadRef.- Parameters:
dstPayloadRef- The value for dstPayloadRef- Returns:
thisbuilder 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 valuedstPayloadRefto dstPayloadRef.- Parameters:
dstPayloadRef- The value for dstPayloadRef- Returns:
thisbuilder for use in a chained invocation
-
encapsulatedByRef
@CanIgnoreReturnValue public final NetworkTraffic.Builder encapsulatedByRef(String encapsulatedByRef) Initializes the optional valueencapsulatedByRefto encapsulatedByRef.- Parameters:
encapsulatedByRef- The value for encapsulatedByRef- Returns:
thisbuilder 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 valueencapsulatedByRefto encapsulatedByRef.- Parameters:
encapsulatedByRef- The value for encapsulatedByRef- Returns:
thisbuilder for use in a chained invocation
-
type
Initializes the value for thetypeattribute.- Parameters:
type- The value for type (can benull)- Returns:
thisbuilder for use in a chained invocation
-
addExtension
@CanIgnoreReturnValue public final NetworkTraffic.Builder addExtension(@Nullable CyberObservableExtension element) Adds one element toextensionsset.- Parameters:
element- A extensions element- Returns:
thisbuilder for use in a chained invocation
-
addExtensions
@CanIgnoreReturnValue public final NetworkTraffic.Builder addExtensions(CyberObservableExtension... elements) Adds elements toextensionsset.- Parameters:
elements- An array of extensions elements- Returns:
thisbuilder 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 forextensionsset.- Parameters:
elements- An iterable of extensions elements- Returns:
thisbuilder for use in a chained invocation
-
addAllExtensions
@CanIgnoreReturnValue public final NetworkTraffic.Builder addAllExtensions(Iterable<? extends CyberObservableExtension> elements) Adds elements toextensionsset.- Parameters:
elements- An iterable of extensions elements- Returns:
thisbuilder for use in a chained invocation
-
observableObjectKey
@CanIgnoreReturnValue public final NetworkTraffic.Builder observableObjectKey(String observableObjectKey) Initializes the value for theobservableObjectKeyattribute.If not set, this attribute will have a default value as returned by the initializer of
observableObjectKey.- Parameters:
observableObjectKey- The value for observableObjectKey- Returns:
thisbuilder for use in a chained invocation
-
defanged
Initializes the optional valuedefangedto defanged.- Parameters:
defanged- The value for defanged- Returns:
thisbuilder 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 valuedefangedto defanged.- Parameters:
defanged- The value for defanged- Returns:
thisbuilder for use in a chained invocation
-
putCustomProperty
@CanIgnoreReturnValue public final NetworkTraffic.Builder putCustomProperty(String key, Object value) Put one entry to thecustomPropertiesmap.- Parameters:
key- The key in the customProperties mapvalue- The associated value in the customProperties map- Returns:
thisbuilder for use in a chained invocation
-
putCustomProperty
@CanIgnoreReturnValue public final NetworkTraffic.Builder putCustomProperty(Map.Entry<String, ? extends Object> entry) Put one entry to thecustomPropertiesmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder 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 thecustomPropertiesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the customProperties map- Returns:
thisbuilder 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 tocustomPropertiesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the customProperties map- Returns:
thisbuilder for use in a chained invocation
-
addObjectMarkingRef
@CanIgnoreReturnValue public final NetworkTraffic.Builder addObjectMarkingRef(@Nullable MarkingDefinitionDm element) Adds one element toobjectMarkingRefsset.- Parameters:
element- A objectMarkingRefs element- Returns:
thisbuilder for use in a chained invocation
-
addObjectMarkingRefs
@CanIgnoreReturnValue public final NetworkTraffic.Builder addObjectMarkingRefs(MarkingDefinitionDm... elements) Adds elements toobjectMarkingRefsset.- Parameters:
elements- An array of objectMarkingRefs elements- Returns:
thisbuilder for use in a chained invocation
-
objectMarkingRefs
@CanIgnoreReturnValue public final NetworkTraffic.Builder objectMarkingRefs(Iterable<? extends MarkingDefinitionDm> elements) Sets or replaces all elements forobjectMarkingRefsset.- Parameters:
elements- An iterable of objectMarkingRefs elements- Returns:
thisbuilder for use in a chained invocation
-
addAllObjectMarkingRefs
@CanIgnoreReturnValue public final NetworkTraffic.Builder addAllObjectMarkingRefs(Iterable<? extends MarkingDefinitionDm> elements) Adds elements toobjectMarkingRefsset.- Parameters:
elements- An iterable of objectMarkingRefs elements- Returns:
thisbuilder for use in a chained invocation
-
addGranularMarking
@CanIgnoreReturnValue public final NetworkTraffic.Builder addGranularMarking(@Nullable GranularMarkingDm element) Adds one element togranularMarkingsset.- Parameters:
element- A granularMarkings element- Returns:
thisbuilder for use in a chained invocation
-
addGranularMarkings
@CanIgnoreReturnValue public final NetworkTraffic.Builder addGranularMarkings(GranularMarkingDm... elements) Adds elements togranularMarkingsset.- Parameters:
elements- An array of granularMarkings elements- Returns:
thisbuilder for use in a chained invocation
-
granularMarkings
@CanIgnoreReturnValue public final NetworkTraffic.Builder granularMarkings(Iterable<? extends GranularMarkingDm> elements) Sets or replaces all elements forgranularMarkingsset.- Parameters:
elements- An iterable of granularMarkings elements- Returns:
thisbuilder for use in a chained invocation
-
addAllGranularMarkings
@CanIgnoreReturnValue public final NetworkTraffic.Builder addAllGranularMarkings(Iterable<? extends GranularMarkingDm> elements) Adds elements togranularMarkingsset.- Parameters:
elements- An iterable of granularMarkings elements- Returns:
thisbuilder for use in a chained invocation
-
hydrated
Initializes the value for thehydratedattribute.- Parameters:
hydrated- The value for hydrated- Returns:
thisbuilder for use in a chained invocation
-
toJsonString
Initializes the value for thetoJsonStringattribute.- Parameters:
toJsonString- The value for toJsonString (can benull)- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newNetworkTraffic.- Returns:
- An immutable instance of NetworkTraffic
- Throws:
IllegalStateException- if any required attributes are missing
-