Class ResetFeatureStateResponse.ResetFeatureStateStatus

java.lang.Object
org.elasticsearch.action.admin.cluster.snapshots.features.ResetFeatureStateResponse.ResetFeatureStateStatus
All Implemented Interfaces:
Writeable, org.elasticsearch.xcontent.ToXContent, org.elasticsearch.xcontent.ToXContentObject
Enclosing class:
ResetFeatureStateResponse

public static class ResetFeatureStateResponse.ResetFeatureStateStatus extends Object implements Writeable, org.elasticsearch.xcontent.ToXContentObject
An object with the name of a feature and a message indicating success or failure.
  • Method Details

    • success

      public static ResetFeatureStateResponse.ResetFeatureStateStatus success(String featureName)
      Create a feature status for a successful reset operation
      Parameters:
      featureName - Name of the feature whose state was successfully reset
      Returns:
      Success status for a feature
    • failure

      public static ResetFeatureStateResponse.ResetFeatureStateStatus failure(String featureName, Exception exception)
      Create a feature status for a failed reset operation
      Parameters:
      featureName - Name of the feature that failed
      exception - The exception that caused or described the failure
      Returns:
      Failure status for a feature
    • getFeatureName

      public String getFeatureName()
      Returns:
      Name of the feature we tried to reset
    • getStatus

      Returns:
      Success or failure for the reset operation
    • getException

      @Nullable public Exception getException()
      Returns:
      For a failed reset operation, the exception that caused or describes the failure.
    • toXContent

      public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.xcontent.ToXContent
      Throws:
      IOException
    • equals

      public boolean equals(Object o)
      Without a convenient way to compare Exception equality, we consider only feature name and success or failure for equality.
      Overrides:
      equals in class Object
      Parameters:
      o - An object to compare for equality
      Returns:
      True if the feature name and status are equal, false otherwise
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      Returns:
      Hash code based only on feature name and status.
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object