Record Class GenericWarning
java.lang.Object
java.lang.Record
co.ankatech.ankasecure.sdk.model.warning.GenericWarning
- Record Components:
rawMessage- the original warning message from the API: server-supplied and unrendered, so a caller displays it throughInertText.text(String)
- All Implemented Interfaces:
CryptoWarning
Generic warning for messages that don't match known patterns.
Acts as a fallback when the API returns warnings that cannot be parsed into specific structured types. Severity is inferred from keyword analysis.
Severity detection keywords:
- CRITICAL - "critical", "urgent", "immediate"
- WARNING - "warning", "caution"
- INFO - Default for unrecognized messages
-
Constructor Summary
ConstructorsConstructorDescriptionGenericWarning(String rawMessage) Creates an instance of aGenericWarningrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.message()Returns the server's warning message.Returns the value of therawMessagerecord component.Returns the recommended action to address this warning.severity()Returns the severity level of this warning.toString()Renders this warning with its server message made terminal-safe.
-
Constructor Details
-
GenericWarning
Creates an instance of aGenericWarningrecord class.- Parameters:
rawMessage- the value for therawMessagerecord component
-
-
Method Details
-
severity
Description copied from interface:CryptoWarningReturns the severity level of this warning.- Specified by:
severityin interfaceCryptoWarning- Returns:
- warning severity (INFO, NOTICE, WARNING, or CRITICAL)
-
message
Returns the server's warning message.Server-supplied and unrendered: display it through
InertText.text(String).- Specified by:
messagein interfaceCryptoWarning- Returns:
- the raw message, as received
-
recommendedAction
Description copied from interface:CryptoWarningReturns the recommended action to address this warning.- Specified by:
recommendedActionin interfaceCryptoWarning- Returns:
- actionable guidance for the user
-
toString
Renders this warning with its server message made terminal-safe. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
rawMessage
Returns the value of therawMessagerecord component.- Returns:
- the value of the
rawMessagerecord component
-