Package org.apache.sling.feature.extension.apiregions.api

# Class ApiRegion

java.lang.Object
org.apache.sling.feature.extension.apiregions.api.ApiRegion

public class ApiRegion extends Object
Describes an api region for Java API This class is not thread safe.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`GLOBAL`
Name of the global region.

## Constructor Summary

Constructors
Constructor
Description
`ApiRegion(String name)`
Create a new named region

## Method Summary

Modifier and Type
Method
Description
`boolean`
`add(ApiExport export)`
Add the export.
`boolean`
`equals(Object obj)`
`ApiExport`
`getAllExportByName(String name)`
Get an export by name
`ApiExport`
`getExportByName(String name)`
Get an export by name
`org.apache.sling.feature.ArtifactId[]`
`getFeatureOrigins()`
`String`
`getName()`
Get the name of the region
`ApiRegion`
`getParent()`
Get the parent region
`Map<String,String>`
`getProperties()`
Get additional properties
`int`
`hashCode()`
`boolean`
`isEmpty()`
Check if the region has exports
`Collection<ApiExport>`
`listAllExports()`
Unmodifiable collection of exports for this region and all parents.
`Collection<ApiExport>`
`listExports()`
Unmodifiable collection of exports for this region
`boolean`
`remove(ApiExport export)`
Remove the export
`void`
`setFeatureOrigins(org.apache.sling.feature.ArtifactId... featureOrigins)`
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Field Details

### GLOBAL

public static final String GLOBAL
Name of the global region.

See Also:
  - Constant Field Values

## Constructor Details

### ApiRegion

public ApiRegion(String name)
Create a new named region

Parameters:
  `name` - The name

## Method Details

### getName

public String getName()
Get the name of the region

Returns:
  The region name

### getFeatureOrigins

public org.apache.sling.feature.ArtifactId[] getFeatureOrigins()

### setFeatureOrigins

public void setFeatureOrigins(org.apache.sling.feature.ArtifactId... featureOrigins)

### add

public boolean add(ApiExport export)
Add the export. The export is only added if there isn't already a export with the same name

Parameters:
  `export` - The export to add
Returns:
  `true` if the export could be added, `false` otherwise

### remove

public boolean remove(ApiExport export)
Remove the export

Parameters:
  `export` - export to remove
Returns:
  `true` if the export got removed.

### isEmpty

public boolean isEmpty()
Check if the region has exports

Returns:
  `true` if it has any export

### listExports

public Collection<ApiExport> listExports()
Unmodifiable collection of exports for this region

Returns:
  The collection of exports

### listAllExports

public Collection<ApiExport> listAllExports()
Unmodifiable collection of exports for this region and all parents.

Returns:
  The collection of exports

### getExportByName

public ApiExport getExportByName(String name)
Get an export by name

Parameters:
  `name` - package name
Returns:
  The export or `null`

### getAllExportByName

public ApiExport getAllExportByName(String name)
Get an export by name

Parameters:
  `name` - package name
Returns:
  The export or `null`

### getProperties

public Map<String,String> getProperties()
Get additional properties

Returns:
  Modifiable map of properties

### getParent

public ApiRegion getParent()
Get the parent region

Returns:
  The parent region or `null`

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### equals

public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`