Class FeatureSaveErrorInfo

java.lang.Object
com.luciad.models.features.FeatureSaveErrorInfo
All Implemented Interfaces:
AutoCloseable

public final class FeatureSaveErrorInfo extends Object implements AutoCloseable
This class contains details on a failed 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.

Since:
2023.1
  • Method Details

    • finalize

      protected void finalize()
      Overrides:
      finalize in class Object
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • newBuilder

      @NotNull public static FeatureSaveErrorInfo.Builder newBuilder()
      Returns a new FeatureSaveErrorInfo builder.
      Returns:
      a new FeatureSaveErrorInfo builder.
    • getGeneralError

      @Nullable public ErrorInfo getGeneralError()
      Returns the cause of the failed save action, if not related to one or more specific features.
      Returns:
      the cause of the failed save action, if not related to one or more specific features.
    • getFeatureError

      @NotNull public ErrorInfo getFeatureError(long featureId) throws IllegalArgumentException
      Retrieves the ErrorInfo associated with a specific feature.
      Returns:
      the ErrorInfo associated with a specific feature.
      Throws:
      IllegalArgumentException - when a featureId with no associated ErrorInfo is used (that is, not in the list obtained from getFeatureIds).
    • getFeatureIds

      @NotNull public List<Long> getFeatureIds()
      Returns the FeatureId's of the features that were involved in the save action failure.

      This is an empty list if the error was not related to a specific feature.

      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.

      Note that an IFeatureModel may abort after the first failure, with other failing feature changes possible being present.

      Returns:
      the FeatureId's of the features that were involved in the save action failure.