Record Class ElementDefinitionRecord
java.lang.Object
java.lang.Record
dev.getelements.elements.sdk.record.ElementDefinitionRecord
- Record Components:
name
- the name of the elementrecursive
- true, if recursiveloader
- the loader typ
public record ElementDefinitionRecord(Package pkg, String name, boolean recursive, List<ElementPackageRecord> additionalPackages, Class<? extends ElementLoader> loader)
extends Record
Represents the record pertaining to the
ElementDefinition
annotation.-
Constructor Summary
ConstructorsConstructorDescriptionElementDefinitionRecord
(Package pkg, String name, boolean recursive, List<ElementPackageRecord> additionalPackages, Class<? extends ElementLoader> loader) Creates an instance of aElementDefinitionRecord
record class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
acceptPackages
(Consumer<String> recursive, Consumer<String> nonRecursive) Iterates over all defined packages in thisElementDefinition
, calling theConsumer
for each defined (including the defining package).Returns the value of theadditionalPackages
record component.final boolean
Indicates whether some other object is "equal to" this one.static ElementDefinitionRecord
fromPackage
(Package aPackage) Gets aElementDefinitionRecord
from aPackage
final int
hashCode()
Returns a hash code value for this object.boolean
isPartOfElement
(Class<?> aClass) boolean
isPartOfElement
(Package aPackage) Class
<? extends ElementLoader> loader()
Returns the value of theloader
record component.name()
Returns the value of thename
record component.pkg()
Returns the value of thepkg
record component.pkgName()
A shortcut to get thePackage
name.boolean
Returns the value of therecursive
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
ElementDefinitionRecord
public ElementDefinitionRecord(Package pkg, String name, boolean recursive, List<ElementPackageRecord> additionalPackages, Class<? extends ElementLoader> loader) Creates an instance of aElementDefinitionRecord
record class.
-
-
Method Details
-
pkgName
A shortcut to get thePackage
name.- Returns:
- the
Package
name.
-
acceptPackages
Iterates over all defined packages in thisElementDefinition
, calling theConsumer
for each defined (including the defining package).- Parameters:
recursive
- called for package defined as recursivenonRecursive
- called for a pakage defined as non-recursive
-
isPartOfElement
-
isPartOfElement
-
fromPackage
Gets aElementDefinitionRecord
from aPackage
- Parameters:
aPackage
- a package- Returns:
- a
ElementDefinitionRecord
-
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
pkg
Returns the value of thepkg
record component.- Returns:
- the value of the
pkg
record component
-
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-
recursive
public boolean recursive()Returns the value of therecursive
record component.- Returns:
- the value of the
recursive
record component
-
additionalPackages
Returns the value of theadditionalPackages
record component.- Returns:
- the value of the
additionalPackages
record component
-
loader
Returns the value of theloader
record component.- Returns:
- the value of the
loader
record component
-