Class ExternalReference.Builder
java.lang.Object
security.whisper.javastix.sdo.types.ExternalReference.Builder
- Enclosing class:
ExternalReference
Builds instances of type
ExternalReference.
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 TypeMethodDescriptionbuild()Builds a newExternalReference.customProperties(Map<String, ? extends Object> entries) Sets or replaces all mappings from the specified map as entries for thecustomPropertiesmap.description(String description) Initializes the optional valuedescriptionto description.description(Optional<String> description) Initializes the optional valuedescriptionto description.externalId(String externalId) Initializes the optional valueexternalIdto externalId.externalId(Optional<String> externalId) Initializes the optional valueexternalIdto externalId.from(StixCustomProperties instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.common.StixCustomPropertiesinstance.from(ExternalReferenceType instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.sdo.types.ExternalReferenceTypeinstance.Sets or replaces all mappings from the specified map as entries for thehashesmap.putAllCustomProperties(Map<String, ? extends Object> entries) Put all mappings from the specified map as entries tocustomPropertiesmap.putAllHashes(Map<String, ? extends String> entries) Put all mappings from the specified map as entries tohashesmap.putCustomProperty(String key, Object value) Put one entry to thecustomPropertiesmap.putCustomProperty(Map.Entry<String, ? extends Object> entry) Put one entry to thecustomPropertiesmap.Put one entry to thehashesmap.Put one entry to thehashesmap.sourceName(String sourceName) Initializes the value for thesourceNameattribute.Initializes the optional valueurlto url.Initializes the optional valueurlto url.
-
Method Details
-
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.sdo.types.ExternalReferenceTypeinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
sourceName
@CanIgnoreReturnValue @JsonPropertyDescription("The source within which the external-reference is defined (system, registry, organization, etc.)") public final ExternalReference.Builder sourceName(String sourceName) Initializes the value for thesourceNameattribute.- Parameters:
sourceName- The value for sourceName (can benull)- Returns:
thisbuilder for use in a chained invocation
-
description
Initializes the optional valuedescriptionto description.- Parameters:
description- The value for description- Returns:
thisbuilder for chained invocation
-
description
@CanIgnoreReturnValue @JsonPropertyDescription("A human readable description") public final ExternalReference.Builder description(Optional<String> description) Initializes the optional valuedescriptionto description.- Parameters:
description- The value for description- Returns:
thisbuilder for use in a chained invocation
-
url
Initializes the optional valueurlto url.- Parameters:
url- The value for url- Returns:
thisbuilder for chained invocation
-
url
@CanIgnoreReturnValue @JsonPropertyDescription("Matches the elements of a URL using a regular expression. Uses Diego Perini\'s regex from https://gist.github.com/dperini/729294.") public final ExternalReference.Builder url(Optional<String> url) Initializes the optional valueurlto url.- Parameters:
url- The value for url- 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
@CanIgnoreReturnValue public final ExternalReference.Builder putHash(Map.Entry<String, ? extends String> entry) 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 file.") public final ExternalReference.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
@CanIgnoreReturnValue public final ExternalReference.Builder putAllHashes(Map<String, ? extends String> entries) 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
-
externalId
Initializes the optional valueexternalIdto externalId.- Parameters:
externalId- The value for externalId- Returns:
thisbuilder for chained invocation
-
externalId
@CanIgnoreReturnValue @JsonPropertyDescription("An identifier for the external reference content") public final ExternalReference.Builder externalId(Optional<String> externalId) Initializes the optional valueexternalIdto externalId.- Parameters:
externalId- The value for externalId- Returns:
thisbuilder for use in a chained invocation
-
putCustomProperty
@CanIgnoreReturnValue public final ExternalReference.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 ExternalReference.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 ExternalReference.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 ExternalReference.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
-
build
Builds a newExternalReference.- Returns:
- An immutable instance of ExternalReference
- Throws:
IllegalStateException- if any required attributes are missing
-