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 aElementDefinitionRecordrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidacceptPackages(Consumer<String> recursive, Consumer<String> nonRecursive) Iterates over all defined packages in thisElementDefinition, calling theConsumerfor each defined (including the defining package).Returns the value of theadditionalPackagesrecord component.final booleanIndicates whether some other object is "equal to" this one.static ElementDefinitionRecordfromPackage(Package aPackage) Gets aElementDefinitionRecordfrom aPackagefinal inthashCode()Returns a hash code value for this object.booleanisPartOfElement(Class<?> aClass) booleanisPartOfElement(Package aPackage) Class<? extends ElementLoader> loader()Returns the value of theloaderrecord component.name()Returns the value of thenamerecord component.pkg()Returns the value of thepkgrecord component.pkgName()A shortcut to get thePackagename.booleanReturns the value of therecursiverecord component.final StringtoString()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 aElementDefinitionRecordrecord class.
-
-
Method Details
-
pkgName
A shortcut to get thePackagename.- Returns:
- the
Packagename.
-
acceptPackages
Iterates over all defined packages in thisElementDefinition, calling theConsumerfor 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 aElementDefinitionRecordfrom 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 thepkgrecord component.- Returns:
- the value of the
pkgrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
recursive
public boolean recursive()Returns the value of therecursiverecord component.- Returns:
- the value of the
recursiverecord component
-
additionalPackages
Returns the value of theadditionalPackagesrecord component.- Returns:
- the value of the
additionalPackagesrecord component
-
loader
Returns the value of theloaderrecord component.- Returns:
- the value of the
loaderrecord component
-