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
ConstructorsConstructorDescriptionMessageResult(ParserMessage parserMessage, int position, Object[] inserts) Creates an instance of aMessageResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Gets a formatted message using position and inserts.final inthashCode()Returns a hash code value for this object.Object[]inserts()Returns the value of theinsertsrecord component.static MessageResultof(ParserMessage parserMessage, int position, Object... inserts) ConstructsMessageResultwith parser message, position and inserts.Returns the value of theparserMessagerecord component.intposition()Returns the value of thepositionrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MessageResult
Creates an instance of aMessageResultrecord class.- Parameters:
parserMessage- the value for theparserMessagerecord componentposition- the value for thepositionrecord componentinserts- the value for theinsertsrecord component
-
-
Method Details
-
of
ConstructsMessageResultwith 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 theparserMessagerecord component.- Returns:
- the value of the
parserMessagerecord component
-
position
public int position()Returns the value of thepositionrecord component.- Returns:
- the value of the
positionrecord component
-
inserts
Returns the value of theinsertsrecord component.- Returns:
- the value of the
insertsrecord component
-