Record Class ValueContextImpl

java.lang.Object
java.lang.Record
org.vaadin.firitin.rad.ValueContextImpl
All Implemented Interfaces:
ValueContext

public record ValueContextImpl(PrettyPrinter prettyPrinter, Class type, Object value, ValueContext parent, com.fasterxml.jackson.databind.introspect.BasicBeanDescription beanDescription) extends Record implements ValueContext
ValueContext is a helper class to pass around the context of the value being displayed/printed.

Experimental, not yet stable API.

  • Constructor Details

    • ValueContextImpl

      public ValueContextImpl(PrettyPrinter prettyPrinter, Object dto)
    • ValueContextImpl

      public ValueContextImpl(PrettyPrinter prettyPrinter, Class type, Object value, ValueContext parent, com.fasterxml.jackson.databind.introspect.BasicBeanDescription beanDescription)
      Creates an instance of a ValueContextImpl record class.
      Parameters:
      prettyPrinter - the value for the prettyPrinter record component
      type - the value for the type record component
      value - the value for the value record component
      parent - the value for the parent record component
      beanDescription - the value for the beanDescription record component
  • Method Details

    • getLocale

      public Locale getLocale()
      Specified by:
      getLocale in interface ValueContext
    • getPrettyPrinter

      public PrettyPrinter getPrettyPrinter()
      Specified by:
      getPrettyPrinter in interface ValueContext
    • getPropertyContext

      public PropertyContext getPropertyContext(com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition property)
      Specified by:
      getPropertyContext in interface ValueContext
    • getLevel

      public int getLevel()
      Specified by:
      getLevel in interface ValueContext
      Returns:
      the level of the property in the object graph
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • prettyPrinter

      public PrettyPrinter prettyPrinter()
      Returns the value of the prettyPrinter record component.
      Returns:
      the value of the prettyPrinter record component
    • type

      public Class type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • value

      public Object value()
      Returns the value of the value record component.
      Specified by:
      value in interface ValueContext
      Returns:
      the value of the value record component
    • parent

      public ValueContext parent()
      Returns the value of the parent record component.
      Specified by:
      parent in interface ValueContext
      Returns:
      the value of the parent record component
    • beanDescription

      public com.fasterxml.jackson.databind.introspect.BasicBeanDescription beanDescription()
      Returns the value of the beanDescription record component.
      Specified by:
      beanDescription in interface ValueContext
      Returns:
      the value of the beanDescription record component