I know that we can create a batch class in java. Thus, the class is internal and is available only in the specified module:
class MyPackagePrivateClass { ... }
Now I am developing an Android library, which I named LibraryA , and I want to use the existing LibraryB in my own LibraryA . How can I prevent LibraryA user LibraryA using LibraryA directly?
Is there any concept, like a packaged private library or something like that?
Update (for those who ask "why do I need this?")
LibraryB has the LibraryB methods:
public QueryBuilder select(String... columns);
But I am convinced that we should use the Type-Safe Enum pattern and prevent users from passing strings to these methods (given the problems of maintenance and refactoring). So I decided to wrap these methods in LibraryA :
public TypedQueryBuilder select(Column... columns) { queryBuilder = queryBuilder.select(toString(columns)); return this; }
Therefore, users of my library should use the Typed methods you provided ( Column is a safe type enum here). But if they have access to the original method, they can use them instead, and I tend to prohibit it.
source share