Class File.Builder
java.lang.Object
security.whisper.javastix.coo.objects.File.Builder
- Enclosing class:
File
-
Method Summary
Modifier and TypeMethodDescriptionfinal File.Builderaccessed(Optional<? extends StixInstant> accessed) Initializes the optional valueaccessedto accessed.final File.Builderaccessed(StixInstant accessed) Initializes the optional valueaccessedto accessed.final File.BuilderaddAllExtensions(Iterable<? extends CyberObservableExtension> elements) Adds elements toextensionsset.final File.BuilderaddAllGranularMarkings(Iterable<? extends GranularMarkingDm> elements) Adds elements togranularMarkingsset.final File.BuilderaddAllObjectMarkingRefs(Iterable<? extends MarkingDefinitionDm> elements) Adds elements toobjectMarkingRefsset.final File.BuilderaddExtension(CyberObservableExtension element) Adds one element toextensionsset.final File.BuilderaddExtensions(CyberObservableExtension... elements) Adds elements toextensionsset.final File.BuilderaddGranularMarking(GranularMarkingDm element) Adds one element togranularMarkingsset.final File.BuilderaddGranularMarkings(GranularMarkingDm... elements) Adds elements togranularMarkingsset.final File.BuilderaddObjectMarkingRef(MarkingDefinitionDm element) Adds one element toobjectMarkingRefsset.final File.BuilderaddObjectMarkingRefs(MarkingDefinitionDm... elements) Adds elements toobjectMarkingRefsset.build()Builds a newFile.final File.BuildercontentRef(String contentRef) Initializes the optional valuecontentRefto contentRef.final File.BuildercontentRef(Optional<String> contentRef) Initializes the optional valuecontentRefto contentRef.final File.Buildercreated(Optional<? extends StixInstant> created) Initializes the optional valuecreatedto created.final File.Buildercreated(StixInstant created) Initializes the optional valuecreatedto created.final File.BuildercustomProperties(Map<String, ? extends Object> entries) Sets or replaces all mappings from the specified map as entries for thecustomPropertiesmap.final File.BuilderdecryptionKey(String decryptionKey) Initializes the optional valuedecryptionKeyto decryptionKey.final File.BuilderdecryptionKey(Optional<String> decryptionKey) Initializes the optional valuedecryptionKeyto decryptionKey.final File.Builderdefanged(boolean defanged) Initializes the optional valuedefangedto defanged.final File.BuilderInitializes the optional valuedefangedto defanged.final File.BuilderencryptionAlgorithm(String encryptionAlgorithm) Initializes the optional valueencryptionAlgorithmto encryptionAlgorithm.final File.BuilderencryptionAlgorithm(Optional<String> encryptionAlgorithm) Initializes the optional valueencryptionAlgorithmto encryptionAlgorithm.final File.Builderextensions(Iterable<? extends CyberObservableExtension> elements) Sets or replaces all elements forextensionsset.final File.Builderfrom(BundleableObject instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.bundle.BundleableObjectinstance.final File.Builderfrom(StixCustomProperties instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.common.StixCustomPropertiesinstance.final File.Builderfrom(CyberObservableObjectCommonProperties instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.coo.CyberObservableObjectCommonPropertiesinstance.final File.BuilderFill a builder with attribute values from the providedsecurity.whisper.javastix.coo.objects.FileCooinstance.final File.BuildergranularMarkings(Iterable<? extends GranularMarkingDm> elements) Sets or replaces all elements forgranularMarkingsset.final File.BuilderSets or replaces all mappings from the specified map as entries for thehashesmap.final File.Builderhydrated(boolean hydrated) Initializes the value for thehydratedattribute.final File.BuilderisEncrypted(boolean isEncrypted) Initializes the optional valueisEncryptedto isEncrypted.final File.BuilderisEncrypted(Optional<Boolean> isEncrypted) Initializes the optional valueisEncryptedto isEncrypted.final File.BuildermagicNumberHex(String magicNumberHex) Initializes the optional valuemagicNumberHexto magicNumberHex.final File.BuildermagicNumberHex(Optional<String> magicNumberHex) Initializes the optional valuemagicNumberHexto magicNumberHex.final File.BuilderInitializes the optional valuemimeTypeto mimeType.final File.BuilderInitializes the optional valuemimeTypeto mimeType.final File.Buildermodified(Optional<? extends StixInstant> modified) Initializes the optional valuemodifiedto modified.final File.Buildermodified(StixInstant modified) Initializes the optional valuemodifiedto modified.final File.BuilderInitializes the optional valuenameto name.final File.BuilderInitializes the optional valuenameto name.final File.BuilderInitializes the optional valuenameEncto nameEnc.final File.BuilderInitializes the optional valuenameEncto nameEnc.final File.BuilderobjectMarkingRefs(Iterable<? extends MarkingDefinitionDm> elements) Sets or replaces all elements forobjectMarkingRefsset.final File.BuilderobservableObjectKey(String observableObjectKey) Initializes the value for theobservableObjectKeyattribute.final File.BuilderparentDirectoryRef(String parentDirectoryRef) Initializes the optional valueparentDirectoryRefto parentDirectoryRef.final File.BuilderparentDirectoryRef(Optional<String> parentDirectoryRef) Initializes the optional valueparentDirectoryRefto parentDirectoryRef.final File.BuilderputAllCustomProperties(Map<String, ? extends Object> entries) Put all mappings from the specified map as entries tocustomPropertiesmap.final File.BuilderputAllHashes(Map<String, ? extends String> entries) Put all mappings from the specified map as entries tohashesmap.final File.BuilderputCustomProperty(String key, Object value) Put one entry to thecustomPropertiesmap.final File.BuilderputCustomProperty(Map.Entry<String, ? extends Object> entry) Put one entry to thecustomPropertiesmap.final File.BuilderPut one entry to thehashesmap.final File.BuilderPut one entry to thehashesmap.final File.Buildersize(long size) Initializes the optional valuesizeto size.final File.BuilderInitializes the optional valuesizeto size.final File.BuildertoJsonString(String toJsonString) Initializes the value for thetoJsonStringattribute.final File.BuilderInitializes the value for thetypeattribute.
-
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.StixCustomPropertiesinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final File.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
-
from
Fill a builder with attribute values from the providedsecurity.whisper.javastix.coo.objects.FileCooinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
putHash
Put one entry to thehashesmap.- Parameters:
key- The key in the hashes mapvalue- The associated value in the hashes map- Returns:
thisbuilder for use in a chained invocation
-
putHash
Put one entry to thehashesmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
hashes
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies a dictionary of hashes for the contents of the file.") public final File.Builder hashes(Map<String, ? extends String> entries) Sets or replaces all mappings from the specified map as entries for thehashesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the hashes map- Returns:
thisbuilder for use in a chained invocation
-
putAllHashes
Put all mappings from the specified map as entries tohashesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the hashes map- Returns:
thisbuilder for use in a chained invocation
-
size
Initializes the optional valuesizeto size.- Parameters:
size- The value for size- Returns:
thisbuilder for chained invocation
-
size
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies the size of the file, in bytes, as a non-negative integer.") public final File.Builder size(Optional<Long> size) Initializes the optional valuesizeto size.- Parameters:
size- The value for size- Returns:
thisbuilder for use in a chained invocation
-
name
Initializes the optional valuenameto name.- Parameters:
name- The value for name- Returns:
thisbuilder for chained invocation
-
name
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies the name of the file.") public final File.Builder name(Optional<String> name) Initializes the optional valuenameto name.- Parameters:
name- The value for name- Returns:
thisbuilder for use in a chained invocation
-
nameEnc
Initializes the optional valuenameEncto nameEnc.- Parameters:
nameEnc- The value for nameEnc- Returns:
thisbuilder for chained invocation
-
nameEnc
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies the observed encoding for the name of the file.") public final File.Builder nameEnc(Optional<String> nameEnc) Initializes the optional valuenameEncto nameEnc.- Parameters:
nameEnc- The value for nameEnc- Returns:
thisbuilder for use in a chained invocation
-
magicNumberHex
Initializes the optional valuemagicNumberHexto magicNumberHex.- Parameters:
magicNumberHex- The value for magicNumberHex- Returns:
thisbuilder for chained invocation
-
magicNumberHex
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies the hexadecimal constant (\'magic number\') associated with a specific file format that corresponds to the file, if applicable.") public final File.Builder magicNumberHex(Optional<String> magicNumberHex) Initializes the optional valuemagicNumberHexto magicNumberHex.- Parameters:
magicNumberHex- The value for magicNumberHex- Returns:
thisbuilder for use in a chained invocation
-
mimeType
Initializes the optional valuemimeTypeto mimeType.- Parameters:
mimeType- The value for mimeType- Returns:
thisbuilder for chained invocation
-
mimeType
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies the MIME type name specified for the file, e.g., \'application/msword\'.") public final File.Builder mimeType(Optional<String> mimeType) Initializes the optional valuemimeTypeto mimeType.- Parameters:
mimeType- The value for mimeType- Returns:
thisbuilder for use in a chained invocation
-
created
Initializes the optional valuecreatedto created.- Parameters:
created- The value for created- Returns:
thisbuilder for chained invocation
-
created
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies the date/time the file was created.") public final File.Builder created(Optional<? extends StixInstant> created) Initializes the optional valuecreatedto created.- Parameters:
created- The value for created- Returns:
thisbuilder for use in a chained invocation
-
modified
Initializes the optional valuemodifiedto modified.- Parameters:
modified- The value for modified- Returns:
thisbuilder for chained invocation
-
modified
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies the date/time the file was last written to/modified.") public final File.Builder modified(Optional<? extends StixInstant> modified) Initializes the optional valuemodifiedto modified.- Parameters:
modified- The value for modified- Returns:
thisbuilder for use in a chained invocation
-
accessed
Initializes the optional valueaccessedto accessed.- Parameters:
accessed- The value for accessed- Returns:
thisbuilder for chained invocation
-
accessed
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies the date/time the file was last accessed.") public final File.Builder accessed(Optional<? extends StixInstant> accessed) Initializes the optional valueaccessedto accessed.- Parameters:
accessed- The value for accessed- Returns:
thisbuilder for use in a chained invocation
-
parentDirectoryRef
Initializes the optional valueparentDirectoryRefto parentDirectoryRef.- Parameters:
parentDirectoryRef- The value for parentDirectoryRef- Returns:
thisbuilder for chained invocation
-
parentDirectoryRef
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies the parent directory of the file, as a reference to a Directory Object.") public final File.Builder parentDirectoryRef(Optional<String> parentDirectoryRef) Initializes the optional valueparentDirectoryRefto parentDirectoryRef.- Parameters:
parentDirectoryRef- The value for parentDirectoryRef- Returns:
thisbuilder for use in a chained invocation
-
isEncrypted
Initializes the optional valueisEncryptedto isEncrypted.- Parameters:
isEncrypted- The value for isEncrypted- Returns:
thisbuilder for chained invocation
-
isEncrypted
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies whether the file is encrypted.") public final File.Builder isEncrypted(Optional<Boolean> isEncrypted) Initializes the optional valueisEncryptedto isEncrypted.- Parameters:
isEncrypted- The value for isEncrypted- Returns:
thisbuilder for use in a chained invocation
-
encryptionAlgorithm
Initializes the optional valueencryptionAlgorithmto encryptionAlgorithm.- Parameters:
encryptionAlgorithm- The value for encryptionAlgorithm- Returns:
thisbuilder for chained invocation
-
encryptionAlgorithm
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies the name of the encryption algorithm used to encrypt the file. Open Vocabulary - encryption-algorithm-ov") public final File.Builder encryptionAlgorithm(Optional<String> encryptionAlgorithm) Initializes the optional valueencryptionAlgorithmto encryptionAlgorithm.- Parameters:
encryptionAlgorithm- The value for encryptionAlgorithm- Returns:
thisbuilder for use in a chained invocation
-
decryptionKey
Initializes the optional valuedecryptionKeyto decryptionKey.- Parameters:
decryptionKey- The value for decryptionKey- Returns:
thisbuilder for chained invocation
-
decryptionKey
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies the decryption key used to decrypt the archive file.") public final File.Builder decryptionKey(Optional<String> decryptionKey) Initializes the optional valuedecryptionKeyto decryptionKey.- Parameters:
decryptionKey- The value for decryptionKey- Returns:
thisbuilder for use in a chained invocation
-
contentRef
Initializes the optional valuecontentRefto contentRef.- Parameters:
contentRef- The value for contentRef- Returns:
thisbuilder for chained invocation
-
contentRef
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies the content of the file, represented as an Artifact Object.") public final File.Builder contentRef(Optional<String> contentRef) Initializes the optional valuecontentRefto contentRef.- Parameters:
contentRef- The value for contentRef- 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 File.Builder addExtension(@Nullable CyberObservableExtension element) Adds one element toextensionsset.- Parameters:
element- A extensions element- Returns:
thisbuilder for use in a chained invocation
-
addExtensions
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 File.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 File.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
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 File.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
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 File.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 File.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 File.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 File.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 File.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 File.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 File.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 File.Builder addGranularMarking(@Nullable GranularMarkingDm element) Adds one element togranularMarkingsset.- Parameters:
element- A granularMarkings element- Returns:
thisbuilder for use in a chained invocation
-
addGranularMarkings
Adds elements togranularMarkingsset.- Parameters:
elements- An array of granularMarkings elements- Returns:
thisbuilder for use in a chained invocation
-
granularMarkings
@CanIgnoreReturnValue public final File.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 File.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 newFile.- Returns:
- An immutable instance of File
- Throws:
IllegalStateException- if any required attributes are missing
-