Class Sighting.Builder
java.lang.Object
security.whisper.javastix.sro.objects.Sighting.Builder
- Enclosing class:
Sighting
-
Method Summary
Modifier and TypeMethodDescriptionfinal Sighting.BuilderaddAllExternalReferences(Iterable<? extends ExternalReferenceType> elements) Adds elements toexternalReferencesset.final Sighting.BuilderaddAllGranularMarkings(Iterable<? extends GranularMarkingDm> elements) Adds elements togranularMarkingsset.final Sighting.BuilderaddAllLabels(Iterable<String> elements) Adds elements tolabelsset.final Sighting.BuilderaddAllObjectMarkingRefs(Iterable<? extends MarkingDefinitionDm> elements) Adds elements toobjectMarkingRefsset.final Sighting.BuilderaddAllObservedDataRefs(Iterable<? extends ObservedDataSdo> elements) Adds elements toobservedDataRefsset.final Sighting.BuilderaddAllWhereSightedRefs(Iterable<? extends IdentitySdo> elements) Adds elements towhereSightedRefsset.final Sighting.BuilderAdds one element toexternalReferencesset.final Sighting.BuilderaddExternalReferences(ExternalReferenceType... elements) Adds elements toexternalReferencesset.final Sighting.BuilderaddGranularMarking(GranularMarkingDm element) Adds one element togranularMarkingsset.final Sighting.BuilderaddGranularMarkings(GranularMarkingDm... elements) Adds elements togranularMarkingsset.final Sighting.BuilderAdds one element tolabelsset.final Sighting.BuilderAdds elements tolabelsset.final Sighting.BuilderaddObjectMarkingRef(MarkingDefinitionDm element) Adds one element toobjectMarkingRefsset.final Sighting.BuilderaddObjectMarkingRefs(MarkingDefinitionDm... elements) Adds elements toobjectMarkingRefsset.final Sighting.BuilderaddObservedDataRef(ObservedDataSdo element) Adds one element toobservedDataRefsset.final Sighting.BuilderaddObservedDataRefs(ObservedDataSdo... elements) Adds elements toobservedDataRefsset.final Sighting.BuilderaddWhereSightedRef(IdentitySdo element) Adds one element towhereSightedRefsset.final Sighting.BuilderaddWhereSightedRefs(IdentitySdo... elements) Adds elements towhereSightedRefsset.build()Builds a newSighting.final Sighting.Buildercount(int count) Initializes the optional valuecountto count.final Sighting.BuilderInitializes the optional valuecountto count.final Sighting.Buildercreated(StixInstant created) Initializes the value for thecreatedattribute.final Sighting.BuildercreatedByRef(Optional<? extends IdentitySdo> createdByRef) Initializes the optional valuecreatedByRefto createdByRef.final Sighting.BuildercreatedByRef(IdentitySdo createdByRef) Initializes the optional valuecreatedByRefto createdByRef.final Sighting.BuildercustomProperties(Map<String, ? extends Object> entries) Sets or replaces all mappings from the specified map as entries for thecustomPropertiesmap.final Sighting.BuilderexternalReferences(Iterable<? extends ExternalReferenceType> elements) Sets or replaces all elements forexternalReferencesset.final Sighting.BuilderfirstSeen(Optional<? extends StixInstant> firstSeen) Initializes the optional valuefirstSeento firstSeen.final Sighting.BuilderfirstSeen(StixInstant firstSeen) Initializes the optional valuefirstSeento firstSeen.final Sighting.Builderfrom(BundleableObject instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.bundle.BundleableObjectinstance.final Sighting.Builderfrom(StixCommonProperties instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.common.StixCommonPropertiesinstance.final Sighting.Builderfrom(StixCustomProperties instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.common.StixCustomPropertiesinstance.final Sighting.Builderfrom(StixLabels instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.common.StixLabelsinstance.final Sighting.Builderfrom(StixModified instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.common.StixModifiedinstance.final Sighting.Builderfrom(StixRevoked instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.common.StixRevokedinstance.final Sighting.Builderfrom(SightingSro instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.sro.objects.SightingSroinstance.final Sighting.BuildergranularMarkings(Iterable<? extends GranularMarkingDm> elements) Sets or replaces all elements forgranularMarkingsset.final Sighting.Builderhydrated(boolean hydrated) Initializes the value for thehydratedattribute.final Sighting.BuilderInitializes the value for theidattribute.final Sighting.BuilderisSummary(StixBoolean isSummary) Initializes the value for theisSummaryattribute.final Sighting.BuilderSets or replaces all elements forlabelsset.final Sighting.BuilderInitializes the optional valuelangto lang.final Sighting.BuilderInitializes the optional valuelangto lang.final Sighting.BuilderlastSeen(Optional<? extends StixInstant> lastSeen) Initializes the optional valuelastSeento lastSeen.final Sighting.BuilderlastSeen(StixInstant lastSeen) Initializes the optional valuelastSeento lastSeen.final Sighting.Buildermodified(StixInstant modified) Initializes the value for themodifiedattribute.final Sighting.BuilderobjectMarkingRefs(Iterable<? extends MarkingDefinitionDm> elements) Sets or replaces all elements forobjectMarkingRefsset.final Sighting.BuilderobservedDataRefs(Iterable<? extends ObservedDataSdo> elements) Sets or replaces all elements forobservedDataRefsset.final Sighting.BuilderputAllCustomProperties(Map<String, ? extends Object> entries) Put all mappings from the specified map as entries tocustomPropertiesmap.final Sighting.BuilderputCustomProperty(String key, Object value) Put one entry to thecustomPropertiesmap.final Sighting.BuilderputCustomProperty(Map.Entry<String, ? extends Object> entry) Put one entry to thecustomPropertiesmap.final Sighting.Builderrevoked(StixBoolean revoked) Initializes the value for therevokedattribute.final Sighting.BuildersightingOfRef(DomainObject sightingOfRef) Initializes the value for thesightingOfRefattribute.final Sighting.BuilderInitializes the value for thetypeattribute.final Sighting.BuilderwhereSightedRefs(Iterable<? extends IdentitySdo> elements) Sets or replaces all elements forwhereSightedRefsset.
-
Method Details
-
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.StixCommonPropertiesinstance.- 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.StixRevokedinstance.- 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
Fill a builder with attribute values from the providedsecurity.whisper.javastix.sro.objects.SightingSroinstance.- 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.StixLabelsinstance.- 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.StixModifiedinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
firstSeen
Initializes the optional valuefirstSeento firstSeen.- Parameters:
firstSeen- The value for firstSeen- Returns:
thisbuilder for chained invocation
-
firstSeen
@CanIgnoreReturnValue @JsonPropertyDescription("The beginning of the time window during which the SDO referenced by the sighting_of_ref property was sighted.") public final Sighting.Builder firstSeen(Optional<? extends StixInstant> firstSeen) Initializes the optional valuefirstSeento firstSeen.- Parameters:
firstSeen- The value for firstSeen- Returns:
thisbuilder for use in a chained invocation
-
lastSeen
Initializes the optional valuelastSeento lastSeen.- Parameters:
lastSeen- The value for lastSeen- Returns:
thisbuilder for chained invocation
-
lastSeen
@CanIgnoreReturnValue @JsonPropertyDescription("The end of the time window during which the SDO referenced by the sighting_of_ref property was sighted.") public final Sighting.Builder lastSeen(Optional<? extends StixInstant> lastSeen) Initializes the optional valuelastSeento lastSeen.- Parameters:
lastSeen- The value for lastSeen- Returns:
thisbuilder for use in a chained invocation
-
count
Initializes the optional valuecountto count.- Parameters:
count- The value for count- Returns:
thisbuilder for chained invocation
-
count
@CanIgnoreReturnValue @JsonPropertyDescription("This is an integer between 0 and 999,999,999 inclusive and represents the number of times the object was sighted.") public final Sighting.Builder count(Optional<Integer> count) Initializes the optional valuecountto count.- Parameters:
count- The value for count- Returns:
thisbuilder for use in a chained invocation
-
sightingOfRef
@CanIgnoreReturnValue @JsonPropertyDescription("An ID reference to the object that has been sighted.") public final Sighting.Builder sightingOfRef(DomainObject sightingOfRef) Initializes the value for thesightingOfRefattribute.- Parameters:
sightingOfRef- The value for sightingOfRef (can benull)- Returns:
thisbuilder for use in a chained invocation
-
addObservedDataRef
@CanIgnoreReturnValue public final Sighting.Builder addObservedDataRef(@Nullable ObservedDataSdo element) Adds one element toobservedDataRefsset.- Parameters:
element- A observedDataRefs element- Returns:
thisbuilder for use in a chained invocation
-
addObservedDataRefs
@CanIgnoreReturnValue public final Sighting.Builder addObservedDataRefs(ObservedDataSdo... elements) Adds elements toobservedDataRefsset.- Parameters:
elements- An array of observedDataRefs elements- Returns:
thisbuilder for use in a chained invocation
-
observedDataRefs
@CanIgnoreReturnValue @JsonPropertyDescription("A list of ID references to the Observed Data objects that contain the raw cyber data for this Sighting.") public final Sighting.Builder observedDataRefs(Iterable<? extends ObservedDataSdo> elements) Sets or replaces all elements forobservedDataRefsset.- Parameters:
elements- An iterable of observedDataRefs elements- Returns:
thisbuilder for use in a chained invocation
-
addAllObservedDataRefs
@CanIgnoreReturnValue public final Sighting.Builder addAllObservedDataRefs(Iterable<? extends ObservedDataSdo> elements) Adds elements toobservedDataRefsset.- Parameters:
elements- An iterable of observedDataRefs elements- Returns:
thisbuilder for use in a chained invocation
-
addWhereSightedRef
@CanIgnoreReturnValue public final Sighting.Builder addWhereSightedRef(@Nullable IdentitySdo element) Adds one element towhereSightedRefsset.- Parameters:
element- A whereSightedRefs element- Returns:
thisbuilder for use in a chained invocation
-
addWhereSightedRefs
Adds elements towhereSightedRefsset.- Parameters:
elements- An array of whereSightedRefs elements- Returns:
thisbuilder for use in a chained invocation
-
whereSightedRefs
@CanIgnoreReturnValue @JsonPropertyDescription("The ID of the Victim Target objects of the entities that saw the sighting.") public final Sighting.Builder whereSightedRefs(Iterable<? extends IdentitySdo> elements) Sets or replaces all elements forwhereSightedRefsset.- Parameters:
elements- An iterable of whereSightedRefs elements- Returns:
thisbuilder for use in a chained invocation
-
addAllWhereSightedRefs
@CanIgnoreReturnValue public final Sighting.Builder addAllWhereSightedRefs(Iterable<? extends IdentitySdo> elements) Adds elements towhereSightedRefsset.- Parameters:
elements- An iterable of whereSightedRefs elements- Returns:
thisbuilder for use in a chained invocation
-
isSummary
@CanIgnoreReturnValue @JsonPropertyDescription("The summary property indicates whether the Sighting should be considered summary data.") public final Sighting.Builder isSummary(StixBoolean isSummary) Initializes the value for theisSummaryattribute.If not set, this attribute will have a default value as returned by the initializer of
isSummary.- Parameters:
isSummary- The value for isSummary- Returns:
thisbuilder for use in a chained invocation
-
hydrated
Initializes the value for thehydratedattribute.If not set, this attribute will have a default value as returned by the initializer of
hydrated.- Parameters:
hydrated- The value for hydrated- Returns:
thisbuilder for use in a chained invocation
-
type
@CanIgnoreReturnValue @JsonPropertyDescription("The type property identifies the type of STIX Object (SDO, Relationship Object, etc). The value of the type field MUST be one of the types defined by a STIX Object (e.g., indicator).") public final Sighting.Builder type(String type) Initializes the value for thetypeattribute.- Parameters:
type- The value for type (can benull)- Returns:
thisbuilder for use in a chained invocation
-
id
@CanIgnoreReturnValue @JsonPropertyDescription("Represents identifiers across the CTI specifications. The format consists of the name of the top-level object being identified, followed by two dashes (--), followed by a UUIDv4.") public final Sighting.Builder id(String id) Initializes the value for theidattribute.- Parameters:
id- The value for id (can benull)- Returns:
thisbuilder for use in a chained invocation
-
createdByRef
Initializes the optional valuecreatedByRefto createdByRef.- Parameters:
createdByRef- The value for createdByRef- Returns:
thisbuilder for chained invocation
-
createdByRef
@CanIgnoreReturnValue @JsonPropertyDescription("Represents identifiers across the CTI specifications. The format consists of the name of the top-level object being identified, followed by two dashes (--), followed by a UUIDv4.") public final Sighting.Builder createdByRef(Optional<? extends IdentitySdo> createdByRef) Initializes the optional valuecreatedByRefto createdByRef.- Parameters:
createdByRef- The value for createdByRef- Returns:
thisbuilder for use in a chained invocation
-
created
@CanIgnoreReturnValue @JsonPropertyDescription("The created property represents the time at which the first version of this object was created. The timstamp value MUST be precise to the nearest millisecond.") public final Sighting.Builder created(StixInstant created) Initializes the value for thecreatedattribute.If not set, this attribute will have a default value as returned by the initializer of
created.- Parameters:
created- The value for created- Returns:
thisbuilder for use in a chained invocation
-
lang
Initializes the optional valuelangto lang.- Parameters:
lang- The value for lang- Returns:
thisbuilder for chained invocation
-
lang
@CanIgnoreReturnValue @JsonPropertyDescription("Identifies the language of the text content in this object using ISO 639-2 language codes.") public final Sighting.Builder lang(Optional<String> lang) Initializes the optional valuelangto lang.- Parameters:
lang- The value for lang- Returns:
thisbuilder for use in a chained invocation
-
addExternalReference
@CanIgnoreReturnValue public final Sighting.Builder addExternalReference(@Nullable ExternalReferenceType element) Adds one element toexternalReferencesset.- Parameters:
element- A externalReferences element- Returns:
thisbuilder for use in a chained invocation
-
addExternalReferences
@CanIgnoreReturnValue public final Sighting.Builder addExternalReferences(ExternalReferenceType... elements) Adds elements toexternalReferencesset.- Parameters:
elements- An array of externalReferences elements- Returns:
thisbuilder for use in a chained invocation
-
externalReferences
@CanIgnoreReturnValue @JsonPropertyDescription("A list of external references which refers to non-STIX information.") public final Sighting.Builder externalReferences(Iterable<? extends ExternalReferenceType> elements) Sets or replaces all elements forexternalReferencesset.- Parameters:
elements- An iterable of externalReferences elements- Returns:
thisbuilder for use in a chained invocation
-
addAllExternalReferences
@CanIgnoreReturnValue public final Sighting.Builder addAllExternalReferences(Iterable<? extends ExternalReferenceType> elements) Adds elements toexternalReferencesset.- Parameters:
elements- An iterable of externalReferences elements- Returns:
thisbuilder for use in a chained invocation
-
addObjectMarkingRef
@CanIgnoreReturnValue public final Sighting.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 Sighting.Builder addObjectMarkingRefs(MarkingDefinitionDm... elements) Adds elements toobjectMarkingRefsset.- Parameters:
elements- An array of objectMarkingRefs elements- Returns:
thisbuilder for use in a chained invocation
-
objectMarkingRefs
@CanIgnoreReturnValue @JsonPropertyDescription("The list of marking-definition objects to be applied to this object.") public final Sighting.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 Sighting.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 Sighting.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 Sighting.Builder addGranularMarkings(GranularMarkingDm... elements) Adds elements togranularMarkingsset.- Parameters:
elements- An array of granularMarkings elements- Returns:
thisbuilder for use in a chained invocation
-
granularMarkings
@CanIgnoreReturnValue @JsonPropertyDescription("The set of granular markings that apply to this object.") public final Sighting.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 Sighting.Builder addAllGranularMarkings(Iterable<? extends GranularMarkingDm> elements) Adds elements togranularMarkingsset.- Parameters:
elements- An iterable of granularMarkings elements- Returns:
thisbuilder for use in a chained invocation
-
putCustomProperty
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 Sighting.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 Sighting.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 Sighting.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
-
addLabel
Adds one element tolabelsset.- Parameters:
element- A labels element- Returns:
thisbuilder for use in a chained invocation
-
addLabels
Adds elements tolabelsset.- Parameters:
elements- An array of labels elements- Returns:
thisbuilder for use in a chained invocation
-
labels
@CanIgnoreReturnValue @JsonPropertyDescription("The labels property specifies a set of classifications.") public final Sighting.Builder labels(Iterable<String> elements) Sets or replaces all elements forlabelsset.- Parameters:
elements- An iterable of labels elements- Returns:
thisbuilder for use in a chained invocation
-
addAllLabels
Adds elements tolabelsset.- Parameters:
elements- An iterable of labels elements- Returns:
thisbuilder for use in a chained invocation
-
modified
@CanIgnoreReturnValue @JsonPropertyDescription("The modified property represents the time that this particular version of the object was created. The timstamp value MUST be precise to the nearest millisecond.") public final Sighting.Builder modified(StixInstant modified) Initializes the value for themodifiedattribute.If not set, this attribute will have a default value as returned by the initializer of
modified.- Parameters:
modified- The value for modified- Returns:
thisbuilder for use in a chained invocation
-
revoked
@CanIgnoreReturnValue @JsonPropertyDescription("The revoked property indicates whether the object has been revoked.") public final Sighting.Builder revoked(StixBoolean revoked) Initializes the value for therevokedattribute.If not set, this attribute will have a default value as returned by the initializer of
revoked.- Parameters:
revoked- The value for revoked- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newSighting.- Returns:
- An immutable instance of Sighting
- Throws:
IllegalStateException- if any required attributes are missing
-