Class Location.Builder

java.lang.Object
security.whisper.javastix.sdo.objects.Location.Builder
Enclosing class:
Location

@NotThreadSafe public static final class Location.Builder extends Object
Builds instances of type Location. 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 Details

    • from

      @CanIgnoreReturnValue public final Location.Builder from(BundleableObject instance)
      Fill a builder with attribute values from the provided security.whisper.javastix.bundle.BundleableObject instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      @CanIgnoreReturnValue public final Location.Builder from(StixCommonProperties instance)
      Fill a builder with attribute values from the provided security.whisper.javastix.common.StixCommonProperties instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      @CanIgnoreReturnValue public final Location.Builder from(StixRevoked instance)
      Fill a builder with attribute values from the provided security.whisper.javastix.common.StixRevoked instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      @CanIgnoreReturnValue public final Location.Builder from(LocationSdo instance)
      Fill a builder with attribute values from the provided security.whisper.javastix.sdo.objects.LocationSdo instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      @CanIgnoreReturnValue public final Location.Builder from(StixCustomProperties instance)
      Fill a builder with attribute values from the provided security.whisper.javastix.common.StixCustomProperties instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      @CanIgnoreReturnValue public final Location.Builder from(StixLabels instance)
      Fill a builder with attribute values from the provided security.whisper.javastix.common.StixLabels instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      @CanIgnoreReturnValue public final Location.Builder from(StixModified instance)
      Fill a builder with attribute values from the provided security.whisper.javastix.common.StixModified instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      @CanIgnoreReturnValue public final Location.Builder from(DomainObject instance)
      Fill a builder with attribute values from the provided security.whisper.javastix.sdo.DomainObject instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • name

      @CanIgnoreReturnValue public final Location.Builder name(String name)
      Initializes the optional value name to name.
      Parameters:
      name - The value for name
      Returns:
      this builder for chained invocation
    • name

      @CanIgnoreReturnValue @JsonPropertyDescription("A name used to identify the Location.") public final Location.Builder name(Optional<String> name)
      Initializes the optional value name to name.
      Parameters:
      name - The value for name
      Returns:
      this builder for use in a chained invocation
    • description

      @CanIgnoreReturnValue public final Location.Builder description(String description)
      Initializes the optional value description to description.
      Parameters:
      description - The value for description
      Returns:
      this builder for chained invocation
    • description

      @CanIgnoreReturnValue @JsonPropertyDescription("A textual description of the Location.") public final Location.Builder description(Optional<String> description)
      Initializes the optional value description to description.
      Parameters:
      description - The value for description
      Returns:
      this builder for use in a chained invocation
    • latitude

      @CanIgnoreReturnValue public final Location.Builder latitude(double latitude)
      Initializes the optional value latitude to latitude.
      Parameters:
      latitude - The value for latitude
      Returns:
      this builder for chained invocation
    • latitude

      @CanIgnoreReturnValue @JsonPropertyDescription("The latitude of the Location in decimal degrees.") public final Location.Builder latitude(Optional<Double> latitude)
      Initializes the optional value latitude to latitude.
      Parameters:
      latitude - The value for latitude
      Returns:
      this builder for use in a chained invocation
    • longitude

      @CanIgnoreReturnValue public final Location.Builder longitude(double longitude)
      Initializes the optional value longitude to longitude.
      Parameters:
      longitude - The value for longitude
      Returns:
      this builder for chained invocation
    • longitude

      @CanIgnoreReturnValue @JsonPropertyDescription("The longitude of the Location in decimal degrees.") public final Location.Builder longitude(Optional<Double> longitude)
      Initializes the optional value longitude to longitude.
      Parameters:
      longitude - The value for longitude
      Returns:
      this builder for use in a chained invocation
    • precision

      @CanIgnoreReturnValue public final Location.Builder precision(double precision)
      Initializes the optional value precision to precision.
      Parameters:
      precision - The value for precision
      Returns:
      this builder for chained invocation
    • precision

      @CanIgnoreReturnValue @JsonPropertyDescription("Defines the precision of the coordinates specified by the latitude and longitude properties in meters.") public final Location.Builder precision(Optional<Double> precision)
      Initializes the optional value precision to precision.
      Parameters:
      precision - The value for precision
      Returns:
      this builder for use in a chained invocation
    • region

      @CanIgnoreReturnValue public final Location.Builder region(String region)
      Initializes the optional value region to region.
      Parameters:
      region - The value for region
      Returns:
      this builder for chained invocation
    • region

      @CanIgnoreReturnValue @JsonPropertyDescription("The region that this Location describes. Open Vocabulary: region-ov") public final Location.Builder region(Optional<String> region)
      Initializes the optional value region to region.
      Parameters:
      region - The value for region
      Returns:
      this builder for use in a chained invocation
    • country

      @CanIgnoreReturnValue public final Location.Builder country(String country)
      Initializes the optional value country to country.
      Parameters:
      country - The value for country
      Returns:
      this builder for chained invocation
    • country

      @CanIgnoreReturnValue @JsonPropertyDescription("The country that this Location describes (ISO 3166-1 ALPHA-2 Code).") public final Location.Builder country(Optional<String> country)
      Initializes the optional value country to country.
      Parameters:
      country - The value for country
      Returns:
      this builder for use in a chained invocation
    • administrativeArea

      @CanIgnoreReturnValue public final Location.Builder administrativeArea(String administrativeArea)
      Initializes the optional value administrativeArea to administrativeArea.
      Parameters:
      administrativeArea - The value for administrativeArea
      Returns:
      this builder for chained invocation
    • administrativeArea

      @CanIgnoreReturnValue @JsonPropertyDescription("The state, province, or other sub-national administrative area that this Location describes.") public final Location.Builder administrativeArea(Optional<String> administrativeArea)
      Initializes the optional value administrativeArea to administrativeArea.
      Parameters:
      administrativeArea - The value for administrativeArea
      Returns:
      this builder for use in a chained invocation
    • city

      @CanIgnoreReturnValue public final Location.Builder city(String city)
      Initializes the optional value city to city.
      Parameters:
      city - The value for city
      Returns:
      this builder for chained invocation
    • city

      @CanIgnoreReturnValue @JsonPropertyDescription("The city that this Location describes.") public final Location.Builder city(Optional<String> city)
      Initializes the optional value city to city.
      Parameters:
      city - The value for city
      Returns:
      this builder for use in a chained invocation
    • streetAddress

      @CanIgnoreReturnValue public final Location.Builder streetAddress(String streetAddress)
      Initializes the optional value streetAddress to streetAddress.
      Parameters:
      streetAddress - The value for streetAddress
      Returns:
      this builder for chained invocation
    • streetAddress

      @CanIgnoreReturnValue @JsonPropertyDescription("The street address that this Location describes.") public final Location.Builder streetAddress(Optional<String> streetAddress)
      Initializes the optional value streetAddress to streetAddress.
      Parameters:
      streetAddress - The value for streetAddress
      Returns:
      this builder for use in a chained invocation
    • postalCode

      @CanIgnoreReturnValue public final Location.Builder postalCode(String postalCode)
      Initializes the optional value postalCode to postalCode.
      Parameters:
      postalCode - The value for postalCode
      Returns:
      this builder for chained invocation
    • postalCode

      @CanIgnoreReturnValue @JsonPropertyDescription("The postal code for this Location.") public final Location.Builder postalCode(Optional<String> postalCode)
      Initializes the optional value postalCode to postalCode.
      Parameters:
      postalCode - The value for postalCode
      Returns:
      this builder for use in a chained invocation
    • addRelationship

      @CanIgnoreReturnValue public final Location.Builder addRelationship(@Nullable RelationshipSro element)
      Adds one element to relationships set.
      Parameters:
      element - A relationships element
      Returns:
      this builder for use in a chained invocation
    • addRelationships

      @CanIgnoreReturnValue public final Location.Builder addRelationships(RelationshipSro... elements)
      Adds elements to relationships set.
      Parameters:
      elements - An array of relationships elements
      Returns:
      this builder for use in a chained invocation
    • relationships

      @CanIgnoreReturnValue public final Location.Builder relationships(Iterable<? extends RelationshipSro> elements)
      Sets or replaces all elements for relationships set.
      Parameters:
      elements - An iterable of relationships elements
      Returns:
      this builder for use in a chained invocation
    • addAllRelationships

      @CanIgnoreReturnValue public final Location.Builder addAllRelationships(Iterable<? extends RelationshipSro> elements)
      Adds elements to relationships set.
      Parameters:
      elements - An iterable of relationships elements
      Returns:
      this builder for use in a chained invocation
    • hydrated

      @CanIgnoreReturnValue public final Location.Builder hydrated(boolean hydrated)
      Initializes the value for the hydrated attribute.

      If not set, this attribute will have a default value as returned by the initializer of hydrated.

      Parameters:
      hydrated - The value for hydrated
      Returns:
      this builder 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 Location.Builder type(String type)
      Initializes the value for the type attribute.
      Parameters:
      type - The value for type (can be null)
      Returns:
      this builder 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 Location.Builder id(String id)
      Initializes the value for the id attribute.
      Parameters:
      id - The value for id (can be null)
      Returns:
      this builder for use in a chained invocation
    • createdByRef

      @CanIgnoreReturnValue public final Location.Builder createdByRef(IdentitySdo createdByRef)
      Initializes the optional value createdByRef to createdByRef.
      Parameters:
      createdByRef - The value for createdByRef
      Returns:
      this builder 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 Location.Builder createdByRef(Optional<? extends IdentitySdo> createdByRef)
      Initializes the optional value createdByRef to createdByRef.
      Parameters:
      createdByRef - The value for createdByRef
      Returns:
      this builder 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 Location.Builder created(StixInstant created)
      Initializes the value for the created attribute.

      If not set, this attribute will have a default value as returned by the initializer of created.

      Parameters:
      created - The value for created
      Returns:
      this builder for use in a chained invocation
    • lang

      @CanIgnoreReturnValue public final Location.Builder lang(String lang)
      Initializes the optional value lang to lang.
      Parameters:
      lang - The value for lang
      Returns:
      this builder for chained invocation
    • lang

      @CanIgnoreReturnValue @JsonPropertyDescription("Identifies the language of the text content in this object using ISO 639-2 language codes.") public final Location.Builder lang(Optional<String> lang)
      Initializes the optional value lang to lang.
      Parameters:
      lang - The value for lang
      Returns:
      this builder for use in a chained invocation
    • addExternalReference

      @CanIgnoreReturnValue public final Location.Builder addExternalReference(@Nullable ExternalReferenceType element)
      Adds one element to externalReferences set.
      Parameters:
      element - A externalReferences element
      Returns:
      this builder for use in a chained invocation
    • addExternalReferences

      @CanIgnoreReturnValue public final Location.Builder addExternalReferences(ExternalReferenceType... elements)
      Adds elements to externalReferences set.
      Parameters:
      elements - An array of externalReferences elements
      Returns:
      this builder for use in a chained invocation
    • externalReferences

      @CanIgnoreReturnValue @JsonPropertyDescription("A list of external references which refers to non-STIX information.") public final Location.Builder externalReferences(Iterable<? extends ExternalReferenceType> elements)
      Sets or replaces all elements for externalReferences set.
      Parameters:
      elements - An iterable of externalReferences elements
      Returns:
      this builder for use in a chained invocation
    • addAllExternalReferences

      @CanIgnoreReturnValue public final Location.Builder addAllExternalReferences(Iterable<? extends ExternalReferenceType> elements)
      Adds elements to externalReferences set.
      Parameters:
      elements - An iterable of externalReferences elements
      Returns:
      this builder for use in a chained invocation
    • addObjectMarkingRef

      @CanIgnoreReturnValue public final Location.Builder addObjectMarkingRef(@Nullable MarkingDefinitionDm element)
      Adds one element to objectMarkingRefs set.
      Parameters:
      element - A objectMarkingRefs element
      Returns:
      this builder for use in a chained invocation
    • addObjectMarkingRefs

      @CanIgnoreReturnValue public final Location.Builder addObjectMarkingRefs(MarkingDefinitionDm... elements)
      Adds elements to objectMarkingRefs set.
      Parameters:
      elements - An array of objectMarkingRefs elements
      Returns:
      this builder for use in a chained invocation
    • objectMarkingRefs

      @CanIgnoreReturnValue @JsonPropertyDescription("The list of marking-definition objects to be applied to this object.") public final Location.Builder objectMarkingRefs(Iterable<? extends MarkingDefinitionDm> elements)
      Sets or replaces all elements for objectMarkingRefs set.
      Parameters:
      elements - An iterable of objectMarkingRefs elements
      Returns:
      this builder for use in a chained invocation
    • addAllObjectMarkingRefs

      @CanIgnoreReturnValue public final Location.Builder addAllObjectMarkingRefs(Iterable<? extends MarkingDefinitionDm> elements)
      Adds elements to objectMarkingRefs set.
      Parameters:
      elements - An iterable of objectMarkingRefs elements
      Returns:
      this builder for use in a chained invocation
    • addGranularMarking

      @CanIgnoreReturnValue public final Location.Builder addGranularMarking(@Nullable GranularMarkingDm element)
      Adds one element to granularMarkings set.
      Parameters:
      element - A granularMarkings element
      Returns:
      this builder for use in a chained invocation
    • addGranularMarkings

      @CanIgnoreReturnValue public final Location.Builder addGranularMarkings(GranularMarkingDm... elements)
      Adds elements to granularMarkings set.
      Parameters:
      elements - An array of granularMarkings elements
      Returns:
      this builder for use in a chained invocation
    • granularMarkings

      @CanIgnoreReturnValue @JsonPropertyDescription("The set of granular markings that apply to this object.") public final Location.Builder granularMarkings(Iterable<? extends GranularMarkingDm> elements)
      Sets or replaces all elements for granularMarkings set.
      Parameters:
      elements - An iterable of granularMarkings elements
      Returns:
      this builder for use in a chained invocation
    • addAllGranularMarkings

      @CanIgnoreReturnValue public final Location.Builder addAllGranularMarkings(Iterable<? extends GranularMarkingDm> elements)
      Adds elements to granularMarkings set.
      Parameters:
      elements - An iterable of granularMarkings elements
      Returns:
      this builder for use in a chained invocation
    • putCustomProperty

      @CanIgnoreReturnValue public final Location.Builder putCustomProperty(String key, Object value)
      Put one entry to the customProperties map.
      Parameters:
      key - The key in the customProperties map
      value - The associated value in the customProperties map
      Returns:
      this builder for use in a chained invocation
    • putCustomProperty

      @CanIgnoreReturnValue public final Location.Builder putCustomProperty(Map.Entry<String,? extends Object> entry)
      Put one entry to the customProperties map. Nulls are not permitted
      Parameters:
      entry - The key and value entry
      Returns:
      this builder for use in a chained invocation
    • customProperties

      @CanIgnoreReturnValue public final Location.Builder customProperties(Map<String,? extends Object> entries)
      Sets or replaces all mappings from the specified map as entries for the customProperties map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the customProperties map
      Returns:
      this builder for use in a chained invocation
    • putAllCustomProperties

      @CanIgnoreReturnValue public final Location.Builder putAllCustomProperties(Map<String,? extends Object> entries)
      Put all mappings from the specified map as entries to customProperties map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the customProperties map
      Returns:
      this builder for use in a chained invocation
    • addLabel

      @CanIgnoreReturnValue public final Location.Builder addLabel(@Nullable String element)
      Adds one element to labels set.
      Parameters:
      element - A labels element
      Returns:
      this builder for use in a chained invocation
    • addLabels

      @CanIgnoreReturnValue public final Location.Builder addLabels(String... elements)
      Adds elements to labels set.
      Parameters:
      elements - An array of labels elements
      Returns:
      this builder for use in a chained invocation
    • labels

      @CanIgnoreReturnValue @JsonPropertyDescription("The labels property specifies a set of classifications.") public final Location.Builder labels(Iterable<String> elements)
      Sets or replaces all elements for labels set.
      Parameters:
      elements - An iterable of labels elements
      Returns:
      this builder for use in a chained invocation
    • addAllLabels

      @CanIgnoreReturnValue public final Location.Builder addAllLabels(Iterable<String> elements)
      Adds elements to labels set.
      Parameters:
      elements - An iterable of labels elements
      Returns:
      this builder 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 Location.Builder modified(StixInstant modified)
      Initializes the value for the modified attribute.

      If not set, this attribute will have a default value as returned by the initializer of modified.

      Parameters:
      modified - The value for modified
      Returns:
      this builder for use in a chained invocation
    • revoked

      @CanIgnoreReturnValue @JsonPropertyDescription("The revoked property indicates whether the object has been revoked.") public final Location.Builder revoked(StixBoolean revoked)
      Initializes the value for the revoked attribute.

      If not set, this attribute will have a default value as returned by the initializer of revoked.

      Parameters:
      revoked - The value for revoked
      Returns:
      this builder for use in a chained invocation
    • build

      public Location build()
      Builds a new Location.
      Returns:
      An immutable instance of Location
      Throws:
      IllegalStateException - if any required attributes are missing