@Retention(value=SOURCE) @Target(value=PACKAGE) public @interface ConstructorAccess
Access.PACKAGE_PRIVATE
will be used.
There are two useful choices to make: PRIVATE or PACKAGE_PRIVATE. PRIVATE is best in the sense of providing the clearest API: the only way to instantiate DataEnum cases is through the static factory method in the top-level type. However, using private constructors leads to the compiler generating synthetic constructor methods, and for Android, you want to keep the method count down. As that is an important use case for DataEnum, we chose PACKAGE_PRIVATE as the default.
public abstract Access value
Copyright © 2023. All rights reserved.