Record Class Property

java.lang.Object
java.lang.Record
ortus.boxlang.runtime.types.Property
Record Components:
name - The name of the property
type - The type of the argument
defaultValue - The default value of the argument
defaultExpression - The default value of the argument as a Lambda to be evaluated at runtime
annotations - Annotations for the property
documentation - Documentation for the property
generatedGetter - The generated getter Function
generatedSetter - The generated setter Function
sourceType - The source type of the property
declaringClass - The class that declares this property

public record Property(Key name, String type, Object defaultValue, DefaultExpression defaultExpression, IStruct annotations, IStruct documentation, Key getterName, Key setterName, UDF generatedGetter, UDF generatedSetter, BoxSourceType sourceType, Class<?> declaringClass) extends Record
Represents a class property
  • Constructor Details

    • Property

      public Property(Key name, String type, Object defaultValue, DefaultExpression defaultExpression, IStruct annotations, IStruct documentation, BoxSourceType sourceType, Class<?> declaringClass)
    • Property

      public Property(Key name, String type, Object defaultValue, DefaultExpression defaultExpression, IStruct annotations, IStruct documentation, Key getterName, Key setterName, UDF generatedGetter, UDF generatedSetter, BoxSourceType sourceType, Class<?> declaringClass)
      Creates an instance of a Property record class.
      Parameters:
      name - the value for the name record component
      type - the value for the type record component
      defaultValue - the value for the defaultValue record component
      defaultExpression - the value for the defaultExpression record component
      annotations - the value for the annotations record component
      documentation - the value for the documentation record component
      getterName - the value for the getterName record component
      setterName - the value for the setterName record component
      generatedGetter - the value for the generatedGetter record component
      generatedSetter - the value for the generatedSetter record component
      sourceType - the value for the sourceType record component
      declaringClass - the value for the declaringClass record component
  • Method Details

    • getDefaultValue

      public Object getDefaultValue(IBoxContext context)
    • getDefaultValueForMeta

      public Object getDefaultValueForMeta()
    • hasDefaultValue

      public boolean hasDefaultValue()
    • 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.
    • name

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

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

      public Object defaultValue()
      Returns the value of the defaultValue record component.
      Returns:
      the value of the defaultValue record component
    • defaultExpression

      public DefaultExpression defaultExpression()
      Returns the value of the defaultExpression record component.
      Returns:
      the value of the defaultExpression record component
    • annotations

      public IStruct annotations()
      Returns the value of the annotations record component.
      Returns:
      the value of the annotations record component
    • documentation

      public IStruct documentation()
      Returns the value of the documentation record component.
      Returns:
      the value of the documentation record component
    • getterName

      public Key getterName()
      Returns the value of the getterName record component.
      Returns:
      the value of the getterName record component
    • setterName

      public Key setterName()
      Returns the value of the setterName record component.
      Returns:
      the value of the setterName record component
    • generatedGetter

      public UDF generatedGetter()
      Returns the value of the generatedGetter record component.
      Returns:
      the value of the generatedGetter record component
    • generatedSetter

      public UDF generatedSetter()
      Returns the value of the generatedSetter record component.
      Returns:
      the value of the generatedSetter record component
    • sourceType

      public BoxSourceType sourceType()
      Returns the value of the sourceType record component.
      Returns:
      the value of the sourceType record component
    • declaringClass

      public Class<?> declaringClass()
      Returns the value of the declaringClass record component.
      Returns:
      the value of the declaringClass record component