Class MoreElements
java.lang.Object
org.immutables.value.processor.meta.MoreElements
Static util methods related to
Element-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static final classprivate static final classprivate static final class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ExecutableElementasExecutable(Element element) Returns the givenElementinstance asExecutableElement.static PackageElementReturns the givenElementinstance asPackageElement.static TypeElementReturns the givenElementinstance asTypeElement.static booleanReturns true if the givenElementinstance is aTypeElement.
-
Constructor Details
-
MoreElements
private MoreElements()
-
-
Method Details
-
isType
Returns true if the givenElementinstance is aTypeElement.This method is functionally equivalent to an
instanceofcheck, but should always be used over that idiom as instructed in the documentation forElement. -
asType
Returns the givenElementinstance asTypeElement.This method is functionally equivalent to an
instanceofcheck and a cast, but should always be used over that idiom as instructed in the documentation forElement.- Throws:
IllegalArgumentException- ifelementisn't aTypeElement.
-
asPackage
Returns the givenElementinstance asPackageElement.This method is functionally equivalent to an
instanceofcheck and a cast, but should always be used over that idiom as instructed in the documentation forElement.- Throws:
IllegalArgumentException- ifelementisn't aTypeElement.
-
asExecutable
Returns the givenElementinstance asExecutableElement.This method is functionally equivalent to an
instanceofcheck and a cast, but should always be used over that idiom as instructed in the documentation forElement.- Throws:
IllegalArgumentException- ifelementisn't aExecutableElement.
-