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

# Class PropertyValidationResult

java.lang.Object
org.apache.sling.feature.extension.apiregions.api.config.validation.PropertyValidationResult

public class PropertyValidationResult extends Object
Validation result for a property This class is not thread safe.

## Constructor Summary

Constructors
Constructor
Description
`PropertyValidationResult()`

## Method Summary

Modifier and Type
Method
Description
`Object`
`getDefaultValue()`
Get the default value.
`List<String>`
`getErrors()`
If `isValid()` returns `false` this returns a list of human readable errors.
`String[]`
`getUseExcludes()`
Get the excludes to be used
`String[]`
`getUseIncludes()`
Get the includes to be used
`List<String>`
`getWarnings()`
Return the list of warnings
`boolean`
`isSkipped()`
Has the validation for this property be skipped?
`boolean`
`isUseDefaultValue()`
Should the default be used instead of the configuration value?
`boolean`
`isValid()`
Is the property value valid?
`void`
`markSkipped()`
Mark the property to be skipped during validation
`void`
`setDefaultValue(Object defaultValue)`
Set the default value
`void`
`setUseDefaultValue(boolean useDefault)`
Set whether the default value should be used
`void`
`setUseIncludesAndExcludes(String[] includes, String[] excludes)`
Set whether the excludes and includes should be used.

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### PropertyValidationResult

public PropertyValidationResult()

## Method Details

### isValid

public boolean isValid()
Is the property value valid?

Returns:
  `true` if the value is valid

### getErrors

public List<String> getErrors()
If `isValid()` returns `false` this returns a list of human readable errors.

Returns:
  A list of errors - empty if `isValid()` returns `true`

### getWarnings

public List<String> getWarnings()
Return the list of warnings

Returns:
  The list of warnings - might be empty

### isSkipped

public boolean isSkipped()
Has the validation for this property be skipped?

Returns:
  `true` if it has been skipped

### markSkipped

public void markSkipped()
Mark the property to be skipped during validation

### isUseDefaultValue

public boolean isUseDefaultValue()
Should the default be used instead of the configuration value?

Returns:
  `true` if the default should be used.
Since:
  1.2
See Also:
  - `getDefaultValue()`

### setUseDefaultValue

public void setUseDefaultValue(boolean useDefault)
Set whether the default value should be used

Parameters:
  `useDefault` - boolean flag
Since:
  1.2

### getDefaultValue

public Object getDefaultValue()
Get the default value. The default value is only returned if `isUseDefaultValue()` returns `true`.

Returns:
  the defaultValue (it might be `null`)
Since:
  1.2

### setDefaultValue

public void setDefaultValue(Object defaultValue)
Set the default value

Parameters:
  `defaultValue` - the defaultValue to set
Since:
  1.2

### getUseExcludes

public String[] getUseExcludes()
Get the excludes to be used

Returns:
  The excludes or `null`
Since:
  1.6

### getUseIncludes

public String[] getUseIncludes()
Get the includes to be used

Returns:
  The includes or `null`
Since:
  1.6

### setUseIncludesAndExcludes

public void setUseIncludesAndExcludes(String[] includes, String[] excludes)
Set whether the excludes and includes should be used. At least one of it should not be `null`

Parameters:
  `includes` - The includes to use
  `excludes` - The excludes to use
Since:
  1.6