I'm working on a app where I have 2 types called Asset, from different packages. I know I can prepend the type with the path of the package, but they're both really long and they both need to be passed as parameters to methods, which looks horrible. the 2 classes I have are:
really.long.path.to.this.one.package.Asset
and
Ridiculusly.long.path.to.this.otherPackage.Asset
Since both types are used in parameters and as returntypes, I end up in this situation:
import really.long.path.to.this.one.package.Asset;
private List<Ridiculusly.long.path.to.this.otherPackage.Asset> getSimilarAssets(Ridiculusly.long.path.to.this.otherPackage.Asset asset,String otherParam){...}
and some methods look even worse, when the non-imoported Asset-type is in the parameter list.
Both types are out of my control, and there is no way for me to exchange one for anything else.
I know I cant import both classes the normal way(this has been answered elsewhere), but can I somehow import a parenting package so that I can get away with writing only part of the path?
It seems to me that if I could import some package that is a parent of one of the Asset
's, I could cut the path in method-definitions down quite a bit. the above method could then look like:
private List<otherPackage.Asset>getSimilarAssets(otherPackage.Asset asset, String otherParam){...}
I assume this would work since the parent package of the 2 classes are different, but I cant seem to get a working reference to the package into my class.any way to do this?