Module io.jstach.opt.spring.example
Record Class HelloModelAndView
java.lang.Object
java.lang.Record
io.jstach.opt.spring.example.hello.HelloModelAndView
- Record Components:
message- The greeting message
- All Implemented Interfaces:
JStachioModelView,View
@JStache(path="hello")
public record HelloModelAndView(String message)
extends Record
implements JStachioModelView
Model that implements
JStachioModelView using a resource template that is in
src/main/resources/views. The path will be expanded via the
JStacheConfig on the projects module.
Because this model implements a Spring View you can return it directly from a
controller.
- Author:
- agentgt
-
Field Summary
Fields inherited from interface io.jstach.opt.spring.webmvc.JStachioModelView
DEFAULT_BUFFER_LIMIT, DEFAULT_MEDIA_TYPEFields inherited from interface org.springframework.web.servlet.View
PATH_VARIABLES, RESPONSE_STATUS_ATTRIBUTE, SELECTED_CONTENT_TYPE -
Constructor Summary
ConstructorsConstructorDescriptionHelloModelAndView(String message) Creates an instance of aHelloModelAndViewrecord 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 value of themessagerecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.jstach.opt.spring.webmvc.JStachioModelView
createOutput, getContentType, getMediaType, jstachio, model, render
-
Constructor Details
-
HelloModelAndView
Creates an instance of aHelloModelAndViewrecord class.- Parameters:
message- the value for themessagerecord component
-
-
Method Details
-
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
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). -
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-