Record Class MessageResult
java.lang.Object
java.lang.Record
org.springframework.shell.command.parser.MessageResult
public record MessageResult(ParserMessage parserMessage, int position, Object[] inserts)
extends Record
Encapsulating
ParserMessage
with position and inserts
.-
Constructor Summary
ConstructorDescriptionMessageResult
(ParserMessage parserMessage, int position, Object[] inserts) Creates an instance of aMessageResult
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.Gets a formatted message using position and inserts.final int
hashCode()
Returns a hash code value for this object.Object[]
inserts()
Returns the value of theinserts
record component.static MessageResult
of
(ParserMessage parserMessage, int position, Object... inserts) ConstructsMessageResult
with parser message, position and inserts.Returns the value of theparserMessage
record component.int
position()
Returns the value of theposition
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
MessageResult
Creates an instance of aMessageResult
record class.- Parameters:
parserMessage
- the value for theparserMessage
record componentposition
- the value for theposition
record componentinserts
- the value for theinserts
record component
-
-
Method Details
-
of
ConstructsMessageResult
with parser message, position and inserts.- Parameters:
parserMessage
- the parser messageposition
- the positioninserts
- the inserts- Returns:
- a message result
-
getMessage
Gets a formatted message using position and inserts.- Returns:
- a formatted message
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
parserMessage
Returns the value of theparserMessage
record component.- Returns:
- the value of the
parserMessage
record component
-
position
public int position()Returns the value of theposition
record component.- Returns:
- the value of the
position
record component
-
inserts
Returns the value of theinserts
record component.- Returns:
- the value of the
inserts
record component
-