public final class FeatureSaveErrorInfo extends Object implements AutoCloseable
IFeatureModel
save
.
It can contain a general error
or one or more feature-specific errors
, or both, but never neither.
A general error
can, for example, be a database connection failure or the lack of permissions to write to a file.
A feature error
can, for example, be a violation of a constraint enforced by the backend on features.
Modifier and Type | Class and Description |
---|---|
static class |
FeatureSaveErrorInfo.Builder
Builder that allows FeatureSaveErrorInfo instances to be created. |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
finalize() |
ErrorInfo |
getFeatureError(long featureId)
Retrieves the
ErrorInfo associated with a specific feature. |
List<Long> |
getFeatureIds()
If the save action fails because one or more features can't be added, updated or removed, this method returns a non-empty list containing the id's of the features involved in the save action failure.
|
ErrorInfo |
getGeneralError()
If the save action failed because of an error not related to specific features, this method returns
information on that error. |
static FeatureSaveErrorInfo.Builder |
newBuilder()
Returns a new
FeatureSaveErrorInfo builder. |
public void close()
close
in interface AutoCloseable
@NotNull public static FeatureSaveErrorInfo.Builder newBuilder()
FeatureSaveErrorInfo
builder.FeatureSaveErrorInfo
builder.@Nullable public ErrorInfo getGeneralError()
information
on that error.@NotNull public ErrorInfo getFeatureError(long featureId) throws IllegalArgumentException
ErrorInfo
associated with a specific feature.ErrorInfo
associated with a specific feature.IllegalArgumentException
- when a featureId with no associated ErrorInfo
is used (that is, not in the list obtained from getFeatureIds
).@NotNull public List<Long> getFeatureIds()
Note that an IFeatureModel
may abort after the first failure, with other failing feature changes possible being present.