Record Class ElementRecord
java.lang.Object
java.lang.Record
dev.getelements.elements.sdk.record.ElementRecord
- Record Components:
type
- theElementType
definition
- theElementDefinitionRecord
housing the definition of the Elementservices
- a list ofElementServiceRecord
housing all services in the Elementattributes
- the actual loadedAttributes
for the ElementdefaultAttributes
- the default attributes of theElement
classLoader
- theClassLoader
used to load theElement
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 Summary
ConstructorsConstructorDescriptionElementRecord
(ElementType type, ElementDefinitionRecord definition, List<ElementServiceRecord> services, List<ElementEventProducerRecord> producedEvents, List<ElementEventConsumerRecord<?>> consumedEvents, Attributes attributes, List<ElementDefaultAttributeRecord> defaultAttributes, ClassLoader classLoader) Creates an instance of aElementRecord
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattributes
record component.Returns the value of theclassLoader
record component.Returns the value of theconsumedEvents
record component.Returns the value of thedefaultAttributes
record component.Returns the value of thedefinition
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of theproducedEvents
record component.services()
Returns the value of theservices
record component.final String
toString()
Returns a string representation of this record class.tryParseServiceKey
(String serviceKeyString) Parses the string representing theElementServiceKey
.type()
Returns the value of thetype
record component.
-
Constructor Details
-
ElementRecord
public ElementRecord(ElementType type, ElementDefinitionRecord definition, List<ElementServiceRecord> services, List<ElementEventProducerRecord> producedEvents, List<ElementEventConsumerRecord<?>> consumedEvents, Attributes attributes, List<ElementDefaultAttributeRecord> defaultAttributes, ClassLoader classLoader) Creates an instance of aElementRecord
record class.- Parameters:
type
- the value for thetype
record componentdefinition
- the value for thedefinition
record componentservices
- the value for theservices
record componentproducedEvents
- the value for theproducedEvents
record componentconsumedEvents
- the value for theconsumedEvents
record componentattributes
- the value for theattributes
record componentdefaultAttributes
- the value for thedefaultAttributes
record componentclassLoader
- the value for theclassLoader
record component
-
-
Method Details
-
tryParseServiceKey
Parses the string representing theElementServiceKey
.- Parameters:
serviceKeyString
- theString
representing theElementServiceKey
- Returns:
- the
ElementServiceKey
-
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
type
Returns the value of thetype
record component.- Returns:
- the value of the
type
record component
-
definition
Returns the value of thedefinition
record component.- Returns:
- the value of the
definition
record component
-
services
Returns the value of theservices
record component.- Returns:
- the value of the
services
record component
-
producedEvents
Returns the value of theproducedEvents
record component.- Returns:
- the value of the
producedEvents
record component
-
consumedEvents
Returns the value of theconsumedEvents
record component.- Returns:
- the value of the
consumedEvents
record component
-
attributes
Returns the value of theattributes
record component.- Returns:
- the value of the
attributes
record component
-
defaultAttributes
Returns the value of thedefaultAttributes
record component.- Returns:
- the value of the
defaultAttributes
record component
-
classLoader
Returns the value of theclassLoader
record component.- Returns:
- the value of the
classLoader
record component
-