Class GenerateLayerOption

java.lang.Object
com.esri.arcgisruntime.tasks.geodatabase.GenerateLayerOption

public final class GenerateLayerOption extends Object
Used in conjunction with GenerateGeodatabaseParameters to refine what layers or tables are included and allows filtering of features within these layers or tables. Used with GeodatabaseSyncTask.generateGeodatabase(GenerateGeodatabaseParameters, String). This applies only to geodatabases using the sync model of SyncModel.PER_LAYER.

You only need to change the properties for layers or tables where you do not want the default behavior. The default behavior is: the extent of the data to be included in the geodatabase is based on GenerateGeodatabaseParameters.setExtent(com.esri.arcgisruntime.geometry.Geometry), geometries are included (isUseGeometry() is true), related records are not returned (isIncludeRelated() is false), no where clause is specified (getWhereClause() is an empty string).

Since:
100.0.0
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Control which features for a layer or table are copied from the server when creating a geodatabase.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a GenerateLayerOption with default values.
    GenerateLayerOption(long layerId)
    Constructs a GenerateLayerOption with a given layer ID and default values.
    GenerateLayerOption(long layerId, boolean includeRelated)
    Constructs a GenerateLayerOption with a given layer ID and the includeRelated flag which causes the generated geodatabase to include features in this layer that are related to features in other layers in the generated geodatabase.
    GenerateLayerOption(long layerId, String whereClause)
    Constructs a GenerateLayerOption with a given layer ID and where-clause which is an attribute query used to select which features in this layer are included in the generated geodatabase.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Gets the ID of the layer this GenerateLayerOption relates to.
    Gets the query option that was set to determine the features to download.
    Gets the where-clause of the layer this GenerateLayerOption relates to.
    boolean
    Gets the value of the includeRelated flag.
    boolean
    Gets the value of the useGeometry flag.
    void
    setIncludeRelated(boolean includeRelated)
    Sets the value of the includeRelated flag.
    void
    setLayerId(long layerId)
    Sets the ID of the layer this GenerateLayerOption relates to.
    void
    Sets the query option that determines the set of features to download.
    void
    setUseGeometry(boolean useGeometry)
    Sets the value of the useGeometry flag.
    void
    setWhereClause(String whereClause)
    Sets the where-clause of the layer this GenerateLayerOption relates to.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GenerateLayerOption

      public GenerateLayerOption()
      Constructs a GenerateLayerOption with default values.
      Since:
      100.0.0
    • GenerateLayerOption

      public GenerateLayerOption(long layerId)
      Constructs a GenerateLayerOption with a given layer ID and default values.
      Parameters:
      layerId - the ID of the layer this GenerateLayerOption relates to, this can be retrieved from ArcGISFeatureLayerInfo.getServiceLayerId()
      Since:
      100.0.0
    • GenerateLayerOption

      public GenerateLayerOption(long layerId, boolean includeRelated)
      Constructs a GenerateLayerOption with a given layer ID and the includeRelated flag which causes the generated geodatabase to include features in this layer that are related to features in other layers in the generated geodatabase. See setIncludeRelated(boolean) for more information.
      Parameters:
      layerId - the ID of the layer this GenerateLayerOption relates to, this can be retrieved from ArcGISFeatureLayerInfo.getServiceLayerId()
      includeRelated - true to include any data from this layer that is related to data in other layers in the geodatabase. This parameters is only valid if the layer participates in any relationships, and if those related layers are also included in the geodatabase.
      Since:
      100.0.0
    • GenerateLayerOption

      public GenerateLayerOption(long layerId, String whereClause)
      Constructs a GenerateLayerOption with a given layer ID and where-clause which is an attribute query used to select which features in this layer are included in the generated geodatabase. See setWhereClause(String) for more information.
      Parameters:
      layerId - the ID of the layer this GenerateLayerOption relates to
      whereClause - an attribute query used to select which features in this layer are included in the generated geodatabase
      Since:
      100.0.0
  • Method Details

    • isIncludeRelated

      public boolean isIncludeRelated()
      Gets the value of the includeRelated flag. If this is true it causes the generated geodatabase to include features in this layer that are related to features in other layers in the generated geodatabase. It is applicable only if the data has relationship classes.
      Returns:
      the value of the includeRelated flag
      Since:
      100.0.0
    • setIncludeRelated

      public void setIncludeRelated(boolean includeRelated)
      Sets the value of the includeRelated flag. Setting this true causes the generated geodatabase to include features in this layer that are related to features in other layers in the generated geodatabase.

      Setting includeRelated to true causes the geometry and where-clause properties to be ignored, and is applicable only if the data has relationship classes. The default value is false.

      Parameters:
      includeRelated - true to include features in this layer that are related to features in other layers in the generated geodatabase
      Since:
      100.0.0
    • getLayerId

      public long getLayerId()
      Gets the ID of the layer this GenerateLayerOption relates to.
      Returns:
      the layer ID, or 0 if none has been set
      Since:
      100.0.0
    • setLayerId

      public void setLayerId(long layerId)
      Sets the ID of the layer this GenerateLayerOption relates to.
      Parameters:
      layerId - the layer ID
      Since:
      100.0.0
    • isUseGeometry

      public boolean isUseGeometry()
      Gets the value of the useGeometry flag. This specifies whether the extent set by GenerateGeodatabaseParameters.setExtent(com.esri.arcgisruntime.geometry.Geometry) is used to filter the features in this layer that are included in the generated geodatabase.
      Returns:
      the value of the useGeometry flag
      Since:
      100.0.0
      See Also:
    • setUseGeometry

      public void setUseGeometry(boolean useGeometry)
      Sets the value of the useGeometry flag. This specifies whether the extent set by GenerateGeodatabaseParameters.setExtent(com.esri.arcgisruntime.geometry.Geometry) is used to filter the features in this layer that are included in the generated geodatabase.

      This property is only applicable if the query option is GenerateLayerOption.QueryOption.USE_FILTER. When it is true, features intersecting the extent that's been set are candidates for taking offline. When it is false, all features are candidates. If a where-clause is also set, it further reduces the features.

      The default value is true. For non-spatial tables it must be set to false.

      Parameters:
      useGeometry - true to use the extent set in GenerateGeodatabaseParameters to filter the features in this layer that are included in the generated geodatabase
      Since:
      100.0.0
    • getWhereClause

      public String getWhereClause()
      Gets the where-clause of the layer this GenerateLayerOption relates to. The where-clause is an attribute query used to select which features in this layer are included in the generated geodatabase.
      Returns:
      the where-clause, or an empty String if none has been set
      Since:
      100.0.0
      See Also:
    • setWhereClause

      public void setWhereClause(String whereClause)
      Sets the where-clause of the layer this GenerateLayerOption relates to. The where-clause is an attribute query used to select which features in this layer are included in the generated geodatabase. The where-clause only applies when the GenerateLayerOption.QueryOption is GenerateLayerOption.QueryOption.USE_FILTER. The default value is an empty string.

      The candidate features from a where-clause are also filtered by the extent set by GenerateGeodatabaseParameters.setExtent(com.esri.arcgisruntime.geometry.Geometry) if isUseGeometry() is true.

      Parameters:
      whereClause - the where-clause
      Since:
      100.0.0
    • getQueryOption

      public GenerateLayerOption.QueryOption getQueryOption()
      Gets the query option that was set to determine the features to download.
      Returns:
      the query option set to determine the features to download, or GenerateLayerOption.QueryOption.USE_FILTER if none was set
      Since:
      100.1.0
      See Also:
    • setQueryOption

      public void setQueryOption(GenerateLayerOption.QueryOption queryOption)
      Sets the query option that determines the set of features to download. The default value is GenerateLayerOption.QueryOption.USE_FILTER, unless the GenerateLayerOption(long, boolean) constructor is used in which case it is GenerateLayerOption.QueryOption.NONE.

      Determines how other properties of the GenerateLayerOption are applicable, valid combinations are:

      Parameters:
      queryOption - query option that determines the set of features to download
      Throws:
      IllegalArgumentException - if queryOption is null
      Since:
      100.1.0