Class GranularMarking.Builder
java.lang.Object
security.whisper.javastix.datamarkings.GranularMarking.Builder
- Enclosing class:
GranularMarking
Builds instances of type
GranularMarking.
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 newGranularMarking.final GranularMarking.BuildercustomProperties(Map<String, ? extends Object> entries) Sets or replaces all mappings from the specified map as entries for thecustomPropertiesmap.final GranularMarking.Builderfrom(StixCustomProperties instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.common.StixCustomPropertiesinstance.final GranularMarking.Builderfrom(GranularMarkingDm instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.datamarkings.GranularMarkingDminstance.final GranularMarking.BuildermarkingRef(MarkingDefinitionDm markingRef) Initializes the value for themarkingRefattribute.final GranularMarking.BuilderputAllCustomProperties(Map<String, ? extends Object> entries) Put all mappings from the specified map as entries tocustomPropertiesmap.final GranularMarking.BuilderputCustomProperty(String key, Object value) Put one entry to thecustomPropertiesmap.final GranularMarking.BuilderputCustomProperty(Map.Entry<String, ? extends Object> entry) Put one entry to thecustomPropertiesmap.
-
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.datamarkings.GranularMarkingDminstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
markingRef
@CanIgnoreReturnValue public final GranularMarking.Builder markingRef(MarkingDefinitionDm markingRef) Initializes the value for themarkingRefattribute.- Parameters:
markingRef- The value for markingRef (can benull)- Returns:
thisbuilder for use in a chained invocation
-
putCustomProperty
@CanIgnoreReturnValue public final GranularMarking.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 GranularMarking.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 GranularMarking.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 GranularMarking.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 newGranularMarking.- Returns:
- An immutable instance of GranularMarking
- Throws:
IllegalStateException- if any required attributes are missing
-