Package com.android.support
Class AndroidxName
- java.lang.Object
-
- com.android.support.AndroidxName
-
public class AndroidxName extends java.lang.ObjectType representing an Android Support Library name. This type contains both the old name and the new name of a class. The type also returns a "default name" that will be changed from the old to new eventually.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringdefaultName()Returns thecom.android.supportversion of the name.booleanisEquals(java.lang.String strName)Compares the current name with the given stringbooleanisEqualsIgnoreCase(java.lang.String strName)Compares the current name with the given string ignoring case sensitivitybooleanisPrefix(java.lang.String name)Returns if the current name is a prefix of the given name.booleanisPrefix(java.lang.String name, boolean strict)Returns if the current name is a prefix of the given name.java.lang.StringnewName()Returns theandroidxversion of the namestatic AndroidxNameof(AndroidxName pkg, java.lang.String simpleClassName)Creates a new instance for the given package and class namestatic AndroidxNameof(java.lang.String oldPackageName)Creates a new package instance for for the package in thecom.android.supportstatic AndroidxNameof(java.lang.String oldPackage, java.lang.String simpleClassName)Creates a new instance for the package in thecom.android.supportand class namejava.lang.StringoldName()Returns thecom.android.supportversion of the namejava.lang.StringremoveFrom(java.lang.String qualifiedName)Removes the current name from the given qualified name.java.lang.StringtoString()
-
-
-
Method Detail
-
of
@NonNull public static AndroidxName of(@NonNull java.lang.String oldPackage, @NonNull java.lang.String simpleClassName)
Creates a new instance for the package in thecom.android.supportand class name
-
of
@NonNull public static AndroidxName of(@NonNull AndroidxName pkg, @NonNull java.lang.String simpleClassName)
Creates a new instance for the given package and class name
-
of
@NonNull public static AndroidxName of(@NonNull java.lang.String oldPackageName)
Creates a new package instance for for the package in thecom.android.support
-
oldName
@NonNull public java.lang.String oldName()
Returns thecom.android.supportversion of the name
-
newName
@NonNull public java.lang.String newName()
Returns theandroidxversion of the name
-
defaultName
@NonNull public java.lang.String defaultName()
-
isPrefix
public boolean isPrefix(@Nullable java.lang.String name)Returns if the current name is a prefix of the given name.
-
isPrefix
public boolean isPrefix(@Nullable java.lang.String name, boolean strict)Returns if the current name is a prefix of the given name.- Parameters:
name- the name to checkstrict- true if the name needs to be strictly longer than the prefix
-
removeFrom
public java.lang.String removeFrom(@NonNull java.lang.String qualifiedName)Removes the current name from the given qualified name.For example, if the
AndroidxNameis "android" and the passed qualifiedName is "android.TestClass", this method, will return "TestClass"
-
isEquals
public boolean isEquals(@Nullable java.lang.String strName)Compares the current name with the given string
-
isEqualsIgnoreCase
public boolean isEqualsIgnoreCase(@Nullable java.lang.String strName)Compares the current name with the given string ignoring case sensitivity
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-