Record Class ElementRecord

java.lang.Object
java.lang.Record
dev.getelements.elements.sdk.record.ElementRecord
Record Components:
type - the ElementType
definition - the ElementDefinitionRecord housing the definition of the Element
services - a list of ElementServiceRecord housing all services in the Element
attributes - the actual loaded Attributes for the Element
defaultAttributes - the default attributes of the Element
classLoader - the ClassLoader used to load the Element

public record ElementRecord(ElementType type, ElementDefinitionRecord definition, List<ElementServiceRecord> services, List<ElementEventProducerRecord> producedEvents, List<ElementEventConsumerRecord<?>> consumedEvents, Attributes attributes, List<ElementDefaultAttributeRecord> defaultAttributes, ClassLoader classLoader) extends Record
A Record type encapsulating all of the metadata for a particular Element. This is derived from various sources, which are mostly reflections of the annotation.
  • Constructor Details

  • Method Details

    • tryParseServiceKey

      public Optional<ElementServiceKey<?>> tryParseServiceKey(String serviceKeyString)
      Parses the string representing the ElementServiceKey.
      Parameters:
      serviceKeyString - the String representing the ElementServiceKey
      Returns:
      the ElementServiceKey
    • 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.
    • type

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

      public ElementDefinitionRecord definition()
      Returns the value of the definition record component.
      Returns:
      the value of the definition record component
    • services

      public List<ElementServiceRecord> services()
      Returns the value of the services record component.
      Returns:
      the value of the services record component
    • producedEvents

      public List<ElementEventProducerRecord> producedEvents()
      Returns the value of the producedEvents record component.
      Returns:
      the value of the producedEvents record component
    • consumedEvents

      public List<ElementEventConsumerRecord<?>> consumedEvents()
      Returns the value of the consumedEvents record component.
      Returns:
      the value of the consumedEvents record component
    • attributes

      public Attributes attributes()
      Returns the value of the attributes record component.
      Returns:
      the value of the attributes record component
    • defaultAttributes

      public List<ElementDefaultAttributeRecord> defaultAttributes()
      Returns the value of the defaultAttributes record component.
      Returns:
      the value of the defaultAttributes record component
    • classLoader

      public ClassLoader classLoader()
      Returns the value of the classLoader record component.
      Returns:
      the value of the classLoader record component