Class PropertiesCoreExtension<TGeoPackage extends GeoPackageCore,TRow extends UserCoreRow<?,?>,TResult extends UserCoreResult<?,?,TRow>,TDao extends UserCoreDao<?,?,TRow,TResult>>
- java.lang.Object
-
- mil.nga.geopackage.extension.BaseExtension
-
- mil.nga.geopackage.extension.nga.properties.PropertiesCoreExtension<TGeoPackage,TRow,TResult,TDao>
-
- Type Parameters:
TGeoPackage
- GeoPackage typeTRow
- row typeTResult
- result typeTDao
- DAO type
public abstract class PropertiesCoreExtension<TGeoPackage extends GeoPackageCore,TRow extends UserCoreRow<?,?>,TResult extends UserCoreResult<?,?,TRow>,TDao extends UserCoreDao<?,?,TRow,TResult>> extends BaseExtension
GeoPackage properties core extension for defining GeoPackage specific properties, attributes, and metadatahttp://ngageoint.github.io/GeoPackage/docs/extensions/properties.html
- Since:
- 3.0.2
- Author:
- osbornb
-
-
Field Summary
Fields Modifier and Type Field Description static String
COLUMN_PROPERTY
Property columnstatic String
COLUMN_VALUE
Value columnstatic String
EXTENSION_AUTHOR
Extension authorstatic String
EXTENSION_DEFINITION
Extension definition URLstatic String
EXTENSION_NAME
Extension, with author and namestatic String
EXTENSION_NAME_NO_AUTHOR
Extension name without the authorstatic String
TABLE_NAME
Table name-
Fields inherited from class mil.nga.geopackage.extension.BaseExtension
extensionsDao, geoPackage
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PropertiesCoreExtension(TGeoPackage geoPackage)
Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
addValue(String property, String value)
Add a property value, creating the extension if neededint
deleteAll()
Delete all properties and valuesint
deleteProperty(String property)
Delete the property and all the property valuesint
deleteValue(String property, String value)
Delete the property valueprotected abstract TDao
getDao()
Get the table Data Access ObjectTGeoPackage
getGeoPackage()
Get the GeoPackageExtensions
getOrCreate()
Get or create the extensionList<String>
getProperties()
Get the propertiesString
getValue(String property)
Get the first value for the propertyList<String>
getValues(String property)
Get the values for the propertyboolean
has()
Determine if the GeoPackage has the extensionboolean
hasProperty(String property)
Check if the property exists, same call ashasValues(String)
boolean
hasSingleValue(String property)
Check if the property has a single valueboolean
hasValue(String property, String value)
Check if the property has the valueboolean
hasValues(String property)
Check if the property has any valuesprotected abstract TRow
newRow()
Get a new rowint
numProperties()
Get the number of propertiesint
numValues()
Get the number of total values combined for all propertiesint
numValues(String property)
Get the number of values for the propertyvoid
removeExtension()
Remove the extension-
Methods inherited from class mil.nga.geopackage.extension.BaseExtension
createDao, get, getExtensions, getExtensions, getExtensionsDao, getOrCreate, has, has, has, verifyWritable
-
-
-
-
Field Detail
-
EXTENSION_AUTHOR
public static final String EXTENSION_AUTHOR
Extension author- See Also:
- Constant Field Values
-
EXTENSION_NAME_NO_AUTHOR
public static final String EXTENSION_NAME_NO_AUTHOR
Extension name without the author- See Also:
- Constant Field Values
-
EXTENSION_NAME
public static final String EXTENSION_NAME
Extension, with author and name
-
EXTENSION_DEFINITION
public static final String EXTENSION_DEFINITION
Extension definition URL
-
TABLE_NAME
public static final String TABLE_NAME
Table name
-
COLUMN_PROPERTY
public static final String COLUMN_PROPERTY
Property column- See Also:
- Constant Field Values
-
COLUMN_VALUE
public static final String COLUMN_VALUE
Value column- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PropertiesCoreExtension
protected PropertiesCoreExtension(TGeoPackage geoPackage)
Constructor- Parameters:
geoPackage
- GeoPackage
-
-
Method Detail
-
getGeoPackage
public TGeoPackage getGeoPackage()
Get the GeoPackage- Overrides:
getGeoPackage
in classBaseExtension
- Returns:
- geoPackage
-
getOrCreate
public Extensions getOrCreate()
Get or create the extension- Returns:
- extension
-
has
public boolean has()
Determine if the GeoPackage has the extension- Returns:
- true if has extension
-
getDao
protected abstract TDao getDao()
Get the table Data Access Object- Returns:
- Data Access Object
-
newRow
protected abstract TRow newRow()
Get a new row- Returns:
- new row
-
numProperties
public int numProperties()
Get the number of properties- Returns:
- property count
-
hasProperty
public boolean hasProperty(String property)
Check if the property exists, same call ashasValues(String)
- Parameters:
property
- property name- Returns:
- true if has property
-
numValues
public int numValues()
Get the number of total values combined for all properties- Returns:
- number of total property values
-
numValues
public int numValues(String property)
Get the number of values for the property- Parameters:
property
- property name- Returns:
- number of values
-
hasSingleValue
public boolean hasSingleValue(String property)
Check if the property has a single value- Parameters:
property
- property name- Returns:
- true if has a single value
-
hasValues
public boolean hasValues(String property)
Check if the property has any values- Parameters:
property
- property name- Returns:
- true if has any values
-
getValue
public String getValue(String property)
Get the first value for the property- Parameters:
property
- property name- Returns:
- value or null
-
getValues
public List<String> getValues(String property)
Get the values for the property- Parameters:
property
- property name- Returns:
- list of values
-
hasValue
public boolean hasValue(String property, String value)
Check if the property has the value- Parameters:
property
- property namevalue
- property value- Returns:
- true if property has the value
-
addValue
public boolean addValue(String property, String value)
Add a property value, creating the extension if needed- Parameters:
property
- property namevalue
- value- Returns:
- true if added, false if already existed
-
deleteProperty
public int deleteProperty(String property)
Delete the property and all the property values- Parameters:
property
- property name- Returns:
- deleted values count
-
deleteValue
public int deleteValue(String property, String value)
Delete the property value- Parameters:
property
- property namevalue
- property value- Returns:
- deleted values count
-
deleteAll
public int deleteAll()
Delete all properties and values- Returns:
- deleted values count
-
removeExtension
public void removeExtension()
Remove the extension
-
-